|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.w3c.tools.resources.AttributeHolder | +--org.w3c.tools.resources.Resource | +--org.w3c.tools.resources.indexer.SampleResourceIndexer
A container for directories and templates.
Field Summary | |
protected static int |
ATTR_CONTEXT
Attribute index - the context (a nasty hack) |
protected static int |
ATTR_LAST_MODIFIED
Attribute index - Date of last modification. |
protected static int |
ATTR_SUPER_INDEXER
Attribute index - the super indexer, if any. |
protected org.w3c.tools.resources.ResourceReference |
contentTypes
|
protected static java.lang.String |
defname
|
protected org.w3c.tools.resources.ResourceReference |
directories
|
protected static boolean |
extCaseSensitive
|
protected org.w3c.tools.resources.ResourceReference |
extensions
|
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 |
Fields inherited from class org.w3c.tools.resources.AttributeHolder |
attributes,
slowpickle,
values |
Constructor Summary | |
SampleResourceIndexer()
|
|
SampleResourceIndexer(org.w3c.tools.resources.ResourceContext ctxt)
|
Method Summary | |
protected org.w3c.tools.resources.Resource |
createDirectoryResource(java.io.File directory,
org.w3c.tools.resources.RequestInterface req,
java.lang.String name,
java.util.Hashtable defs)
Create a default container resource for this directory (that exists). |
protected org.w3c.tools.resources.Resource |
createFileResource(java.io.File directory,
org.w3c.tools.resources.RequestInterface req,
java.lang.String name,
java.util.Hashtable defs)
Create a default file resource for this file (that exists). |
org.w3c.tools.resources.Resource |
createResource(org.w3c.tools.resources.ContainerResource container,
org.w3c.tools.resources.RequestInterface request,
java.io.File directory,
java.lang.String name,
java.util.Hashtable defs)
Try to create a resource for the given file. |
protected org.w3c.tools.resources.Resource |
createVirtualResource(java.io.File directory,
org.w3c.tools.resources.RequestInterface req,
java.lang.String name,
java.util.Hashtable defs)
Try to create a virtual resource if the real (physical) resource is not there. |
void |
delete()
Delete this inexer |
void |
delete(java.lang.String name)
|
java.util.Enumeration |
enumerateResourceIdentifiers(boolean all)
|
protected org.w3c.tools.resources.ResourceContext |
getContext()
|
protected org.w3c.tools.resources.ResourceReference |
getDirectories()
|
protected org.w3c.tools.resources.ResourceReference |
getExtensions()
|
protected java.lang.String[] |
getFileExtensions(java.lang.String name)
|
protected java.lang.String |
getIndexedDirName(java.lang.String name)
|
protected java.lang.String |
getIndexedFileName(java.lang.String name)
|
java.lang.String |
getIndexedName(java.io.File directory,
java.lang.String name)
Get the name of the resource relative to the given filename. |
java.lang.String |
getSuperIndexer()
|
protected org.w3c.tools.resources.ResourceReference |
getTemplateFor(java.lang.String ext)
Return the class (if any) that our store defines for given extension. |
long |
lastModified()
|
org.w3c.tools.resources.ResourceReference |
loadDirectory(java.lang.String name)
Load a given directory template from the store. |
org.w3c.tools.resources.ResourceReference |
loadExtension(java.lang.String name)
|
org.w3c.tools.resources.ResourceReference |
lookup(java.lang.String name)
|
protected java.util.Hashtable |
mergeDefaultAttributes(org.w3c.tools.resources.Resource template,
java.lang.String ext,
java.util.Hashtable into)
Merge the attributes this extension defines, with the provided ones. |
protected void |
mergeFrameAttributes(org.w3c.tools.resources.ResourceFrame origFrame,
java.lang.String ext,
org.w3c.tools.resources.ResourceReference frameref)
Merge the attributes this extension defines, with the provided ones. |
void |
registerResource(java.lang.String name,
org.w3c.tools.resources.Resource resource,
java.util.Hashtable defs)
|
Methods inherited from class org.w3c.tools.resources.Resource |
acceptUnload,
checkMultipleLock,
collectFrames,
getClone,
getFrame,
getFrames,
getHelpURL,
getHelpURL,
getIdentifier,
getLastModified,
getParent,
getResourceReference,
getServer,
getSpace,
getSpaceEntry,
getStoreEntry,
getURLPath,
getValue,
getValue,
initialize,
isInitialized,
markModified,
notifyUnload,
registerFrame,
setContext,
setContext,
setValue,
setValue,
unregisterFrame,
updateAttributes |
Methods inherited from class org.w3c.tools.resources.AttributeHolder |
definesAttribute,
definesAttribute,
getAttributes,
getBoolean,
getChar,
getClone,
getClone,
getDouble,
getFloat,
getInt,
getLong,
getString,
getValue,
initialize,
lookupAttribute,
pickle,
print,
setBoolean,
setChar,
setDouble,
setFloat,
setInt,
setLong,
setString,
setValue,
unpickle,
unpickle,
unpickle,
unpickleInstance,
unpickleInstance |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static final boolean extCaseSensitive
protected static final java.lang.String defname
protected static int ATTR_LAST_MODIFIED
protected static int ATTR_CONTEXT
protected static int ATTR_SUPER_INDEXER
protected org.w3c.tools.resources.ResourceReference directories
protected org.w3c.tools.resources.ResourceReference extensions
protected org.w3c.tools.resources.ResourceReference contentTypes
Constructor Detail |
public SampleResourceIndexer(org.w3c.tools.resources.ResourceContext ctxt)
public SampleResourceIndexer()
Method Detail |
protected org.w3c.tools.resources.ResourceContext getContext()
protected org.w3c.tools.resources.ResourceReference getDirectories()
protected org.w3c.tools.resources.ResourceReference getExtensions()
public long lastModified()
public java.lang.String getSuperIndexer()
public java.util.Enumeration enumerateResourceIdentifiers(boolean all)
public org.w3c.tools.resources.ResourceReference lookup(java.lang.String name)
public void delete() throws org.w3c.tools.resources.MultipleLockException
public void delete(java.lang.String name)
public void registerResource(java.lang.String name, org.w3c.tools.resources.Resource resource, java.util.Hashtable defs)
public org.w3c.tools.resources.ResourceReference loadExtension(java.lang.String name)
protected org.w3c.tools.resources.ResourceReference getTemplateFor(java.lang.String ext)
ext
- The extension we want a class for.protected java.util.Hashtable mergeDefaultAttributes(org.w3c.tools.resources.Resource template, java.lang.String ext, java.util.Hashtable into)
attrs
- The attributes we want to fill with default values.ext
- The extension name.into
- The already built set of default values.protected void mergeFrameAttributes(org.w3c.tools.resources.ResourceFrame origFrame, java.lang.String ext, org.w3c.tools.resources.ResourceReference frameref)
origFrame
- The original frameext
- The extension nameinto
- The ResourceReference of the frame to be mergedprotected java.lang.String[] getFileExtensions(java.lang.String name)
protected org.w3c.tools.resources.Resource createFileResource(java.io.File directory, org.w3c.tools.resources.RequestInterface req, java.lang.String name, java.util.Hashtable defs)
directory
- The directory of the file.name
- The name of the file.defs
- A set of default attribute values.public org.w3c.tools.resources.ResourceReference loadDirectory(java.lang.String name)
name
- The name of the template to load.protected org.w3c.tools.resources.Resource createDirectoryResource(java.io.File directory, org.w3c.tools.resources.RequestInterface req, java.lang.String name, java.util.Hashtable defs)
directory
- The parent directory.req
- the request that triggered this creationname
- The name of its sub-directory to index.defaults
- A set of default atribute values.protected org.w3c.tools.resources.Resource createVirtualResource(java.io.File directory, org.w3c.tools.resources.RequestInterface req, java.lang.String name, java.util.Hashtable defs)
directory
- The directory the file is in.req
- the request that triggered this creationname
- The name of the file.defs
- Any default attribute values that should be provided
to the created resource at initialization time.public org.w3c.tools.resources.Resource createResource(org.w3c.tools.resources.ContainerResource container, org.w3c.tools.resources.RequestInterface request, java.io.File directory, java.lang.String name, java.util.Hashtable defs)
directory
- The directory the file is in.name
- The name of the file.defs
- Any default attribute values that should be provided
to the created resource at initialization time.public java.lang.String getIndexedName(java.io.File directory, java.lang.String name)
name
- The name of the file.protected java.lang.String getIndexedFileName(java.lang.String name)
protected java.lang.String getIndexedDirName(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |