|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public class DirectoryResource
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. |
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 | |
---|---|
DirectoryResource()
|
Method Summary | |
---|---|
ResourceReference |
createDefaultResource(java.lang.String name)
Create a default child resource in that container. |
protected ResourceReference |
createDefaultResource(java.lang.String name,
RequestInterface req)
Try creating a default resource having the given name. |
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. |
ResourceReference |
createResource(java.lang.String name,
RequestInterface req)
Create a Resource and the physical file too. |
void |
delete()
Delete this directory resource, for ever. |
protected java.util.Enumeration |
enumerateAllResourceIdentifiers()
Enumerate all available children resource identifiers. |
java.util.Enumeration |
enumerateResourceIdentifiers(boolean all)
Enumerate all available children resource identifiers. |
java.io.File |
getDirectory()
Get the physical directory exported by this resource. |
long |
getDirStamp()
Get the absolute time at which we examined the physicall directory. |
boolean |
getExtensibleFlag()
Get the extensible flag value. |
protected java.lang.String |
getIndexedName(java.lang.String name)
Get the name of the resource relative to the given filename. |
protected ResourceReference |
getIndexer(ResourceContext c)
Get the indexer out of the given context. |
boolean |
getShrinkableFlag()
Get the extensible flag value. |
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. |
ResourceReference |
lookup(java.lang.String name)
Lookup the resource having the given name in this directory. |
void |
reindex(boolean rec)
Reindex recursivly all the resources from this DirectoryResource. |
void |
resourceRemoved(StructureChangedEvent evt)
A resource is about to be removed This handles the RESOURCE_REMOVED kind of events. |
void |
setValue(int idx,
java.lang.Object value)
Set some of this resource attribute. |
java.io.File |
unsafeGetDirectory()
Get the physical directory exported by this resource. |
boolean |
unsafeGetShrinkableFlag()
Get the extensible flag value. |
protected ResourceContext |
updateDefaultChildAttributes(java.util.Hashtable attrs)
Initialize and register a new resource into this directory. |
boolean |
verify()
Was return false (don't khow why) |
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.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 |
---|
protected static int ATTR_DIRECTORY
protected static int ATTR_DIRSTAMP
protected static int ATTR_INDEXER
protected static int ATTR_EXTENSIBLE
protected static int ATTR_SHRINKABLE
Constructor Detail |
---|
public DirectoryResource()
Method Detail |
---|
protected ResourceReference getIndexer(ResourceContext c)
public void setValue(int idx, java.lang.Object value)
FramedResource
setValue
in class FramedResource
idx
- The index of the attribute to modify.value
- The new attribute value.public java.io.File getDirectory()
public java.io.File unsafeGetDirectory()
public long getDirStamp()
public boolean getExtensibleFlag()
Setting this flag might slow down the server. It unfortunatelly defaults to true until I have a decent admin program.
public boolean getShrinkableFlag()
Setting this flag might slow down the server. It unfortunatelly defaults to true until I have a decent admin program.
public boolean unsafeGetShrinkableFlag()
Setting this flag might slow down the server. It unfortunatelly defaults to true until I have a decent admin program.
public void resourceRemoved(StructureChangedEvent evt)
RESOURCE_REMOVED
kind of events.
resourceRemoved
in interface StructureChangedListener
resourceRemoved
in class ContainerResource
evt
- The event describing the change.public ResourceReference createDirectoryResource(java.lang.String name)
name
- the name of the resource.
public ResourceReference createResource(java.lang.String name)
name
- the name of the resource.
public ResourceReference createResource(java.lang.String name, RequestInterface req)
name
- the name of the resource.req
- the protocol request.
protected Resource index(java.lang.String name, java.util.Hashtable defs, RequestInterface req)
name
- The name of the resource to index.defs
- The defaults attributes.req
- The protocol request.
SampleResourceIndexer
protected java.lang.String getIndexedName(java.lang.String name)
name
- The name of the file.
SampleResourceIndexer
public ResourceReference createDefaultResource(java.lang.String name)
ContainerResource
createDefaultResource
in class ContainerResource
name
- The identifier for the new resource.protected ResourceReference createDefaultResource(java.lang.String name, RequestInterface req)
name
- The name of the resource to try to create.req
- The incomming request
protected ResourceContext updateDefaultChildAttributes(java.util.Hashtable attrs)
updateDefaultChildAttributes
in class ContainerResource
resource
- The uninitialized resource to be added.public void reindex(boolean rec)
rec
- recursivly?protected java.util.Enumeration enumerateAllResourceIdentifiers()
public java.util.Enumeration enumerateResourceIdentifiers(boolean all)
enumerateResourceIdentifiers
in interface ContainerInterface
enumerateResourceIdentifiers
in class ContainerResource
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).
public ResourceReference lookup(java.lang.String name)
lookup
in interface ContainerInterface
lookup
in class ContainerResource
name
- The name of the resource.
public void delete() throws MultipleLockException
Once the resource is deleted, it isx1 removed from its inital store and will not be unpickleable any more.
delete
in class ContainerResource
MultipleLockException
- if someone has locked this resource.public boolean verify()
public void initialize(java.lang.Object[] values)
initialize
in class ContainerResource
values
- The attribute values.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |