| java.lang.Object org.w3c.tools.resources.AttributeHolder org.w3c.tools.resources.Resource org.w3c.tools.resources.FramedResource org.w3c.tools.resources.AbstractContainer org.w3c.tools.resources.ContainerResource org.w3c.tools.resources.DirectoryResource
All known Subclasses: org.w3c.jigsaw.resources.DirectoryResource, org.w3c.tools.resources.PassDirectory, org.w3c.jigsaw.zip.ZipDirectoryResource,
DirectoryResource | public class DirectoryResource extends ContainerResource (Code) | | A simple, and reasonably efficient directory resource.
|
Field Summary | |
protected static int | ATTR_DIRECTORY Attribute index - The index for our directory attribute. | protected static int | ATTR_DIRSTAMP Attribute index - The last time we physically visited the directory. | protected static int | ATTR_EXTENSIBLE Attribute index - The index of wether we are extensible. | protected static int | ATTR_INDEXER Attribute index - The indexer to use for that directory, if any. | protected static int | ATTR_SHRINKABLE Attribute index - The index of wether we can be shrinked. | static String | di |
ATTR_DIRECTORY | protected static int ATTR_DIRECTORY(Code) | | Attribute index - The index for our directory attribute.
|
ATTR_DIRSTAMP | protected static int ATTR_DIRSTAMP(Code) | | Attribute index - The last time we physically visited the directory.
|
ATTR_EXTENSIBLE | protected static int ATTR_EXTENSIBLE(Code) | | Attribute index - The index of wether we are extensible.
|
ATTR_INDEXER | protected static int ATTR_INDEXER(Code) | | Attribute index - The indexer to use for that directory, if any.
|
ATTR_SHRINKABLE | protected static int ATTR_SHRINKABLE(Code) | | Attribute index - The index of wether we can be shrinked.
|
createDefaultResource | protected synchronized ResourceReference createDefaultResource(String name, RequestInterface req)(Code) | | Try creating a default resource having the given name.
This method will make its best effort to create a default resource
having this name in the directory. If a file with this name exists,
it will check the pre-defined admin extensions and look for a match.
If a directory with this name exists, and admin allows to do so, it
will create a sub-directory resource.
Parameters: name - The name of the resource to try to create. Parameters: req - The incomming request A Resource instance, if possible, nullotherwise. |
createDirectoryResource | public ResourceReference createDirectoryResource(String name)(Code) | | Create a DirectoryResource and the physical directory too.
Parameters: name - the name of the resource. A ResourceReference instance. |
createResource | public ResourceReference createResource(String name)(Code) | | Create a Resource and the physical file too.
Parameters: name - the name of the resource. A ResourceReference instance. |
createResource | public ResourceReference createResource(String name, RequestInterface req)(Code) | | Create a Resource and the physical file too.
Parameters: name - the name of the resource. Parameters: req - the protocol request. A ResourceReference instance. |
delete | public synchronized void delete() throws MultipleLockException(Code) | | Delete this directory resource, for ever.
This method will delete the directory resource, and its associated
store, along with any of the sub-resources it contains.
Deleting the root directory of your server might take sometime...
Once the resource is deleted, it isx1 removed from its inital store
and will not be unpickleable any more.
exception: MultipleLockException - if someone has locked this resource. |
enumerateAllResourceIdentifiers | protected synchronized Enumeration enumerateAllResourceIdentifiers()(Code) | | Enumerate all available children resource identifiers.
This method requires that we create all our pending resources.
An enumeration of all our resources. |
enumerateResourceIdentifiers | public synchronized Enumeration enumerateResourceIdentifiers(boolean all)(Code) | | 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 !
An enumeration of all our resources. |
getDirStamp | public long getDirStamp()(Code) | | Get the absolute time at which we examined the physicall directory.
The date (as a long number of ms since Java epoch), or-1 if we never examined it before. |
getDirectory | public File getDirectory()(Code) | | Get the physical directory exported by this resource.
A non-null File object giving the directory of this resource. |
getExtensibleFlag | public boolean getExtensibleFlag()(Code) | | Get the extensible flag value.
A DirectoryResource is extensible, if it is allowed to create new
resources out of the file system knowledge on the fly.
Setting this flag might slow down the server. It unfortunatelly
defaults to true until I have a decent admin
program.
A boolean true if the directory isextensible. |
getShrinkableFlag | public boolean getShrinkableFlag()(Code) | | Get the extensible flag value.
A DirectoryResource is extensible, if it is allowed to create new
resources out of the file system knowledge on the fly.
Setting this flag might slow down the server. It unfortunatelly
defaults to true until I have a decent admin
program.
A boolean true if the directory isextensible. |
initialize | public void initialize(Object values)(Code) | | Initialize this directory resource with the given set of attributes.
Parameters: values - The attribute values. |
lookup | public ResourceReference lookup(String name)(Code) | | Lookup the resource having the given name in this directory.
Parameters: name - The name of the resource. A resource instance, or null. |
reindex | public synchronized void reindex(boolean rec)(Code) | | Reindex recursivly all the resources from this DirectoryResource.
Parameters: rec - recursivly? |
resourceRemoved | public void resourceRemoved(StructureChangedEvent evt)(Code) | | A resource is about to be removed
This handles the RESOURCE_REMOVED kind of events.
Parameters: evt - The event describing the change. |
unsafeGetDirectory | public File unsafeGetDirectory()(Code) | | Get the physical directory exported by this resource.
A non-null File object giving the directory of this resource. |
unsafeGetShrinkableFlag | public boolean unsafeGetShrinkableFlag()(Code) | | Get the extensible flag value.
A DirectoryResource is extensible, if it is allowed to create new
resources out of the file system knowledge on the fly.
Setting this flag might slow down the server. It unfortunatelly
defaults to true until I have a decent admin
program.
A boolean true if the directory isextensible. |
updateDefaultChildAttributes | protected ResourceContext updateDefaultChildAttributes(Hashtable attrs)(Code) | | Initialize and register a new resource into this directory.
Parameters: resource - The uninitialized resource to be added. |
verify | public synchronized boolean verify()(Code) | | Was return false (don't khow why)
|
Methods inherited from org.w3c.tools.resources.FramedResource | public void addAttributeChangedListener(AttributeChangedListener l)(Code)(Java Doc) public void addStructureChangedListener(StructureChangedListener l)(Code)(Java Doc) public synchronized ResourceReference[] collectFramesReference(Class c)(Code)(Java Doc) public synchronized void delete() throws MultipleLockException(Code)(Java Doc) protected void disableEvent()(Code)(Java Doc) protected void displayEvent(FramedResource fr, EventObject evt)(Code)(Java Doc) protected void enableEvent()(Code)(Java Doc) protected boolean eventDisabled()(Code)(Java Doc) protected void fireAttributeChangeEvent(AttributeChangedEvent evt)(Code)(Java Doc) protected void fireStructureChangedEvent(int type)(Code)(Java Doc) protected void fireStructureChangedEvent(StructureChangedEvent evt)(Code)(Java Doc) public void frameAdded(FrameEvent evt)(Code)(Java Doc) public void frameModified(FrameEvent evt)(Code)(Java Doc) public void frameRemoved(FrameEvent evt)(Code)(Java Doc) public Object getClone(Object values)(Code)(Java Doc) public synchronized ResourceFrame getFrame(Class c, String identifier)(Code)(Java Doc) public synchronized ResourceFrame getFrame(String classname)(Code)(Java Doc) public synchronized ResourceReference getFrameReference(Class c)(Code)(Java Doc) public synchronized ResourceReference getFrameReference(ResourceFrame frame)(Code)(Java Doc) public synchronized ResourceReference[] getFramesReference()(Code)(Java Doc) public int getOid()(Code)(Java Doc) public void initialize(Object values)(Code)(Java Doc) public boolean lookup(LookupState ls, LookupResult lr) throws ProtocolException(Code)(Java Doc) public void markModified()(Code)(Java Doc) public void notifyUnload()(Code)(Java Doc) public ReplyInterface perform(RequestInterface request) throws ProtocolException, ResourceException(Code)(Java Doc) protected ReplyInterface performFrames(RequestInterface request) throws ProtocolException, ResourceException(Code)(Java Doc) protected void postAttributeChangeEvent(int idx, Object newvalue)(Code)(Java Doc) public void postEvent(ResourceEvent evt)(Code)(Java Doc) protected void postStructureChangedEvent(ResourceReference rr, int type)(Code)(Java Doc) protected void postStructureChangedEvent(int type)(Code)(Java Doc) public void processEvent(ResourceEvent evt)(Code)(Java Doc) public void registerFrame(ResourceFrame frame, Hashtable defs)(Code)(Java Doc) protected void registerFrameIfNone(String classname, String identifier) throws ClassNotFoundException, IllegalAccessException, InstantiationException, ClassCastException(Code)(Java Doc) public void removeAttributeChangedListener(AttributeChangedListener l)(Code)(Java Doc) public void removeStructureChangedListener(StructureChangedListener l)(Code)(Java Doc) public synchronized void setSilentValue(int idx, Object value)(Code)(Java Doc) public synchronized void setSilentValue(String name, Object value)(Code)(Java Doc) public synchronized void setValue(int idx, Object value)(Code)(Java Doc) public synchronized void unregisterFrame(ResourceFrame frame)(Code)(Java Doc) ResourceFrame unsafeGetFrame(Class c, String identifier)(Code)(Java Doc)
|
Methods inherited from org.w3c.tools.resources.AttributeHolder | public boolean definesAttribute(int idx) throws IllegalAttributeAccess(Code)(Java Doc) public boolean definesAttribute(String name) throws IllegalAttributeAccess(Code)(Java Doc) public Attribute[] getAttributes()(Code)(Java Doc) public boolean getBoolean(int idx, boolean def)(Code)(Java Doc) public char getChar(int idx, char def)(Code)(Java Doc) public Object getClone(Object values)(Code)(Java Doc) public synchronized Object getClone()(Code)(Java Doc) public synchronized Object getClone(Hashtable defs)(Code)(Java Doc) public double getDouble(int idx, double def)(Code)(Java Doc) public float getFloat(int idx, float def)(Code)(Java Doc) public int getInt(int idx, int def)(Code)(Java Doc) public long getLong(int idx, long def)(Code)(Java Doc) public String getString(int idx, String def)(Code)(Java Doc) public synchronized Object getValue(int idx, Object def) throws IllegalAttributeAccess(Code)(Java Doc) public Object getValue(String name, Object def) throws IllegalAttributeAccess(Code)(Java Doc) public synchronized void initialize(Object nvalues)(Code)(Java Doc) public synchronized void initialize(Hashtable defs)(Code)(Java Doc) public int lookupAttribute(String name)(Code)(Java Doc) public synchronized void pickleValues(Hashtable defs)(Code)(Java Doc) public void print(PrintStream out)(Code)(Java Doc) public void setBoolean(int idx, boolean b)(Code)(Java Doc) public void setChar(int idx, char ch) throws IllegalAttributeAccess(Code)(Java Doc) public void setDouble(int idx, double d) throws IllegalAttributeAccess(Code)(Java Doc) public void setFloat(int idx, float f) throws IllegalAttributeAccess(Code)(Java Doc) public void setInt(int idx, int i) throws IllegalAttributeAccess(Code)(Java Doc) public void setLong(int idx, long l) throws IllegalAttributeAccess(Code)(Java Doc) public void setString(int idx, String s) throws IllegalAttributeAccess(Code)(Java Doc) public synchronized void setValue(int idx, Object value)(Code)(Java Doc) public void setValue(String name, Object value)(Code)(Java Doc) public boolean unsafeDefinesAttribute(int idx) throws IllegalAttributeAccess(Code)(Java Doc) public double unsafeGetDouble(int idx, double def)(Code)(Java Doc) public String unsafeGetString(int idx, String def)(Code)(Java Doc) public Object unsafeGetValue(int idx, Object def) throws IllegalAttributeAccess(Code)(Java Doc)
|
|
|