01: // ResourceIndexer.java
02: // $Id: ResourceIndexer.java,v 1.5 2000/08/16 21:37:54 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1996.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.tools.resources.indexer;
07:
08: import java.util.Hashtable;
09:
10: import java.io.File;
11:
12: import org.w3c.tools.resources.ContainerResource;
13: import org.w3c.tools.resources.RequestInterface;
14: import org.w3c.tools.resources.Resource;
15:
16: /**
17: * Jigsaw indexer.
18: * The indexer is an object that given some global configuration informations,
19: * tries to build default resources for files that the server doesn't know
20: * about.
21: * A ResourceIndexer <strong>must</strong> be a resource it is to be added
22: * permanently to the IndexersCatalog.
23: * @see IndexersCatalog
24: */
25:
26: public interface ResourceIndexer {
27:
28: /**
29: * When was this indexer configuration last modified.
30: * @return The date at which that indexer was last modified, as
31: * a number of milliseconds since Java epoch.
32: */
33:
34: abstract public long lastModified();
35:
36: /**
37: * Try to create a resource for the given file.
38: * This method makes its best efforts to try to build a default
39: * resource out of a file.
40: * @param container The container making the call.
41: * @param request The HTTP request that triggered the call to the indexer
42: * (may be <strong>null</strong>).
43: * @param directory The directory the file is in.
44: * @param name The name of the file.
45: * @param defs Any default attribute values that should be provided
46: * to the created resource at initialization time.
47: * @return A Resource instance, or <strong>null</strong> if the given
48: * file can't be truned into a resource given our configuration
49: * database.
50: */
51:
52: abstract public Resource createResource(
53: ContainerResource container, RequestInterface request,
54: File directory, String name, Hashtable defs);
55:
56: /**
57: * Get the name of the resource relative to the given filename.
58: * @param name The name of the file.
59: * @return a String, the resource name.
60: */
61: abstract public String getIndexedName(File directory, String name);
62:
63: }
|