KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > archive > Entry


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.archive;
8
9 import org.ejtools.archive.io.Reader;
10 import org.ejtools.archive.io.Writer;
11
12
13 /**
14  * Interface that defines an archive entry.
15  *
16  * @author Laurent Etiemble
17  * @version $Revision: 1.2 $
18  */

19 public interface Entry
20 {
21    /**
22     * Visitor Pattern method to accept a Reader visitor
23     *
24     * @param visitor The reader visitor
25     */

26    public void accept(Reader visitor);
27
28
29    /**
30     * Visitor Pattern method to accept a Writer visitor
31     *
32     * @param visitor The writer visitor
33     */

34    public void accept(Writer visitor);
35
36
37    /**
38     * Adds this entry to an archive
39     *
40     * @param archive The archive to be added to
41     */

42    public void addTo(Archive archive);
43
44
45    /**
46     * Is this entry an archive ?
47     *
48     * @return True if this entry is an archive
49     */

50    public boolean isArchive();
51
52
53    /**
54     * Return the absolute URI of this entry
55     *
56     * @return The URI
57     */

58    public String JavaDoc getURI();
59
60
61    /**
62     * Sets the URI of this entry
63     *
64     * @param uri The new URI
65     */

66    public void setURI(String JavaDoc uri);
67
68
69    /**
70     * Sets the content of this entry
71     *
72     * @param content The new content
73     */

74    public void setContent(byte[] content);
75
76
77    /**
78     * Returns the content of this entry
79     *
80     * @return The content
81     */

82    public byte[] getContent();
83 }
84
Popular Tags