28 |
* Currently mostly a placeholder to get the storm interfaces |
* Currently mostly a placeholder to get the storm interfaces |
29 |
* to compile-- NEEDS THINKING. |
* to compile-- NEEDS THINKING. |
30 |
* <p> |
* <p> |
31 |
|
* Subclasses will often provide: |
32 |
|
* <ul> |
33 |
|
* <li>An empty constructor for creating an empty header.</li> |
34 |
|
* <li>A constructor taking another <code>Header822</code>, |
35 |
|
* for creating a header initialized with the data |
36 |
|
* from another header.</li> |
37 |
|
* <li>A constructor taking a String, for creating a header |
38 |
|
* initialized with a given <code>Content-Type</code> value.</li> |
39 |
|
* </ul> |
40 |
|
* <p> |
41 |
* (Note: This isn't called <code>Header2822</code> because |
* (Note: This isn't called <code>Header2822</code> because |
42 |
* that would be clumsier to type, especially in subclasses-- |
* that would be clumsier to type, especially in subclasses-- |
43 |
* <code>UniqueHeader2822</code> and so on. Then again, |
* <code>UniqueHeader2822</code> and so on. Then again, |
45 |
* makes it not RFC822-compliant...) |
* makes it not RFC822-compliant...) |
46 |
*/ |
*/ |
47 |
public interface Header822 { |
public interface Header822 { |
48 |
|
// get single String, just value, no folding inside |
49 |
String getOne(String field) throws IOException; |
String getOne(String field) throws IOException; |
50 |
|
|
51 |
|
// get collection of Strings, just values, no folding inside |
52 |
Collection getAll(String field) throws IOException; |
Collection getAll(String field) throws IOException; |
53 |
|
|
54 |
|
// get collection of Strings, whole fields, i.e. field name |
55 |
|
// plus field value, folded |
56 |
Collection getLines() throws IOException; |
Collection getLines() throws IOException; |
57 |
void write(OutputStream out) throws IOException; |
|
58 |
|
// add field |
59 |
|
void add(String fieldName, String fieldValue) |
60 |
|
throws IOException, UnsupportedOperationException; |
61 |
|
|
62 |
|
// add field raw (as a single String containing field name |
63 |
|
// *and* field value, possibly folded) |
64 |
|
void add(String field) throws IOException, UnsupportedOperationException; |
65 |
|
|
66 |
|
// write to an output stream |
67 |
|
void writeTo(OutputStream out) throws IOException; |
68 |
|
|
69 |
// XXX think, document... |
// XXX think, document... |
70 |
} |
} |