1 package org.naftulin.classpathexplorer;
2
3 import org.naftulin.classpathexplorer.dublicate.imlp.AccessibleArchive;
4
5 /***
6 * Represents an accessible resource: its location, last modified time, etc.
7 * @author henry naftulin
8 * @version 1.0
9 */
10 public interface AccessibleResource {
11 /***
12 * Returns a key for the resource.
13 * Key is used for resource registry to recognize dublicate resources.
14 * For archives it's a path (with the name of the archive). For
15 * files it's the path of the file within an archive and the file name.
16 * @return a key identifying a resource.
17 */
18 String getKey();
19 /***
20 * Returns the archive the resource is located in.
21 * @return the archive the resource is located in.
22 */
23 AccessibleArchive getArchive();
24
25 /***
26 * Returns the path for the resource. If resource resides in an archive,
27 * (e.g. zip or jar) path represents a full path: path to the
28 * archive and path of the resource within an archive.
29 * @return the path for the resource.
30 */
31 String getFullPath();
32
33 /***
34 * Returns the last modified Date as long
35 * @return the last modified Date as long
36 */
37 long getLastModified();
38
39 /***
40 * Returns the name of the resource.
41 * @return the name of the resource.
42 */
43 String getName();
44
45 /***
46 * Returns the path for the resource. If resource resides in an archive,
47 * (e.g. zip or jar) path represents a path of the resource within an
48 * archive.
49 * @return the path for the resource.
50 */
51 String getPath();
52
53 /***
54 * Returns the string representation of the resource.
55 * @return the string representation of the resource.
56 */
57 String toString();
58
59 /***
60 * Returns the xml representation of the resource.
61 * @return the xml representation of the resource.
62 */
63 String toXml();
64 }