KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > boot > RepositoryStore


1 package com.sslexplorer.boot;
2
3 import java.io.IOException JavaDoc;
4 import java.io.InputStream JavaDoc;
5 import java.io.OutputStream JavaDoc;
6
7 /**
8  * A single {@link Repository} may contain multiple stores. This interface
9  * abstracts these stores.
10  * <p>
11  * A single store may contain multiple named <i>Entries</i>. Each of these
12  * entries is simple a blob of data that may accessed via I/O streams.
13  *
14  *
15  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
16  */

17 public interface RepositoryStore {
18
19     /**
20      * Get a named entry as an input stream. If not such entry exists then
21      * a {@link java.io.FileNotFoundException} will be thrown.
22      *
23      * @param name name of entry
24      * @return input stream
25      * @throws IOException on any error including file not found
26      */

27     public InputStream JavaDoc getEntryInputStream(String JavaDoc name) throws IOException JavaDoc;
28     
29     /**
30      * Get an output stream for a named entry which may be written to. If
31      * an entry with the same name already exists it will be overwritten.
32      *
33      * @param name name of entry
34      * @return output stream which may be written to
35      * @throws IOException on any error
36      */

37     public OutputStream JavaDoc getEntryOutputStream(String JavaDoc name) throws IOException JavaDoc;
38     
39     /**
40      * Remove an entry given its name.
41      *
42      * @param name name of entry to remove
43      * @throws IOException on any error
44      */

45     public void removeEntry(String JavaDoc name) throws IOException JavaDoc;
46     
47     /**
48      * Get if a named entry exists.
49      *
50      * @param name name of entry
51      * @return entry exists
52      */

53     public boolean hasEntry(String JavaDoc name);
54     
55     /**
56      * Get a list of all entry names.
57      *
58      * @return entry names
59      */

60     public String JavaDoc[] listEntries();
61 }
62
Popular Tags