org.w3c.jigsaw.zip
Class ZipDirectoryResource

java.lang.Object
  extended by org.w3c.tools.resources.AttributeHolder
      extended by org.w3c.tools.resources.Resource
          extended by org.w3c.tools.resources.FramedResource
              extended by org.w3c.tools.resources.AbstractContainer
                  extended by org.w3c.tools.resources.ContainerResource
                      extended by org.w3c.tools.resources.DirectoryResource
                          extended by org.w3c.jigsaw.zip.ZipDirectoryResource
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, ContainerInterface, AttributeChangedListener, FrameEventListener, StructureChangedListener

public class ZipDirectoryResource
extends DirectoryResource


Field Summary
protected static int ATTR_ENTRYPATH
          Attribute index - The index for our entry path.
protected static int ATTR_ZIPFILE
          Attributes index - The filename attribute.
protected  java.util.Hashtable directories
           
 
Fields inherited from class org.w3c.tools.resources.DirectoryResource
ATTR_DIRECTORY, ATTR_DIRSTAMP, ATTR_EXTENSIBLE, ATTR_INDEXER, ATTR_SHRINKABLE
 
Fields inherited from class org.w3c.tools.resources.ContainerResource
acquired, ATTR_KEY, debug
 
Fields inherited from class org.w3c.tools.resources.AbstractContainer
ur
 
Fields inherited from class org.w3c.tools.resources.FramedResource
ATTR_OID, attrListener, debugEvent, event_disabled, framesRef, structListener
 
Fields inherited from class org.w3c.tools.resources.Resource
ATTR_CONTEXT, ATTR_HELP_URL, ATTR_IDENTIFIER, ATTR_LAST_MODIFIED, ATTR_PARENT, ATTR_RESOURCE_FRAMES, ATTR_STORE_ENTRY, ATTR_URL, co, id
 
Fields inherited from class org.w3c.tools.resources.AttributeHolder
attributes, values
 
Constructor Summary
ZipDirectoryResource()
           
 
Method Summary
 ResourceReference createDirectoryResource(java.lang.String name)
          Create a DirectoryResource and the physical directory too.
 ResourceReference createResource(java.lang.String name)
          Create a Resource and the physical file too.
protected  boolean entryExists(java.lang.String name)
           
protected  java.util.Enumeration enumerateAllResourceIdentifiers()
          Enumerate all available children resource identifiers.
 java.util.Enumeration enumerateResourceIdentifiers(boolean all)
          Enumerate all available children resource identifiers.
 java.lang.String getEntryPath()
           
 java.io.File getZipFile()
          Get this zip file.
 boolean hasEntry()
           
protected  Resource index(java.lang.String name, java.util.Hashtable defs, RequestInterface req)
          Index a Resource.
 void initialize(java.lang.Object[] values)
          Initialize this directory resource with the given set of attributes.
 void reindex()
          Reindex recursivly all the resources from this DirectoryResource.
protected  ResourceContext updateDefaultChildAttributes(java.util.Hashtable attrs)
          Initialize and register a new resource into this directory.
 
Methods inherited from class org.w3c.tools.resources.DirectoryResource
createDefaultResource, createDefaultResource, createResource, delete, getDirectory, getDirStamp, getExtensibleFlag, getIndexedName, getIndexer, getShrinkableFlag, lookup, reindex, resourceRemoved, setValue, unsafeGetDirectory, unsafeGetShrinkableFlag, verify
 
Methods inherited from class org.w3c.tools.resources.ContainerResource
acquireChildren, addResource, delete, deleteChildren, getChildrenSpaceEntry, getClone, getKey, getMatchingCharsCount, getSpaceEntry, internalLookup, lookup, notifyUnload, registerResource, replace, resourceCreated, resourceModified
 
Methods inherited from class org.w3c.tools.resources.AbstractContainer
attributeChanged, enumerateResourceIdentifiers, resourceUnloaded
 
Methods inherited from class org.w3c.tools.resources.FramedResource
addAttributeChangedListener, addStructureChangedListener, collectFramesReference, disableEvent, displayEvent, enableEvent, eventDisabled, fireAttributeChangeEvent, fireStructureChangedEvent, fireStructureChangedEvent, frameAdded, frameModified, frameRemoved, getFrame, getFrame, getFrameReference, getFrameReference, getFramesReference, getOid, markModified, perform, performFrames, postAttributeChangeEvent, postEvent, postStructureChangedEvent, postStructureChangedEvent, processEvent, registerFrame, registerFrameIfNone, removeAttributeChangedListener, removeStructureChangedListener, setSilentValue, setSilentValue, unregisterFrame
 
Methods inherited from class org.w3c.tools.resources.Resource
acceptUnload, checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getResourceReference, getServer, getSpace, getStoreEntry, getURLPath, getValue, getValue, initialize, isInitialized, isUnloaded, pickleValues, setContext, setContext, setValue, unsafeGetContext, unsafeGetFrame, unsafeGetFrames, unsafeGetIdentifier, unsafeGetResourceReference, unsafeGetURLPath, unsafeGetValue, updateAttributes
 
Methods inherited from class org.w3c.tools.resources.AttributeHolder
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_ZIPFILE

protected static int ATTR_ZIPFILE
Attributes index - The filename attribute.


ATTR_ENTRYPATH

protected static int ATTR_ENTRYPATH
Attribute index - The index for our entry path.


directories

protected java.util.Hashtable directories
Constructor Detail

ZipDirectoryResource

public ZipDirectoryResource()
Method Detail

getZipFile

public java.io.File getZipFile()
Get this zip file.


getEntryPath

public java.lang.String getEntryPath()

enumerateAllResourceIdentifiers

protected java.util.Enumeration enumerateAllResourceIdentifiers()
Enumerate all available children resource identifiers. This method requires that we create all our pending resources.

Overrides:
enumerateAllResourceIdentifiers in class DirectoryResource
Returns:
An enumeration of all our resources.

reindex

public void reindex()
Reindex recursivly all the resources from this DirectoryResource.


updateDefaultChildAttributes

protected ResourceContext updateDefaultChildAttributes(java.util.Hashtable attrs)
Initialize and register a new resource into this directory.

Overrides:
updateDefaultChildAttributes in class DirectoryResource
Parameters:
resource - The uninitialized resource to be added.

enumerateResourceIdentifiers

public java.util.Enumeration enumerateResourceIdentifiers(boolean all)
Enumerate all available children resource identifiers. This method requires that we create all our pending resources if we are in the extensible mode...too bad !

Specified by:
enumerateResourceIdentifiers in interface ContainerInterface
Overrides:
enumerateResourceIdentifiers in class DirectoryResource
Parameters:
all - Should all resources be enumerated ? Resources are often created on demand only, this flag allows the caller to tell the container about wether it is interested only in already created resources, or in all resources (even the one that have not yet been created).
Returns:
An enumeration of all our resources.

entryExists

protected boolean entryExists(java.lang.String name)

index

protected Resource index(java.lang.String name,
                         java.util.Hashtable defs,
                         RequestInterface req)
Index a Resource. Call the indexer.

Overrides:
index in class DirectoryResource
Parameters:
name - The name of the resource to index.
defs - The defaults attributes.
req - The protocol request.
Returns:
A resource instance.
See Also:
SampleResourceIndexer

createResource

public ResourceReference createResource(java.lang.String name)
Create a Resource and the physical file too.

Overrides:
createResource in class DirectoryResource
Parameters:
name - the name of the resource.
Returns:
A ResourceReference instance.

createDirectoryResource

public ResourceReference createDirectoryResource(java.lang.String name)
Create a DirectoryResource and the physical directory too.

Overrides:
createDirectoryResource in class DirectoryResource
Parameters:
name - the name of the resource.
Returns:
A ResourceReference instance.

initialize

public void initialize(java.lang.Object[] values)
Description copied from class: DirectoryResource
Initialize this directory resource with the given set of attributes.

Overrides:
initialize in class DirectoryResource
Parameters:
values - The attribute values.

hasEntry

public boolean hasEntry()