01: // MimeHeaderHolder.java
02: // $Id: MimeHeaderHolder.java,v 1.6 2000/08/16 21:38:01 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.www.mime;
07:
08: import java.io.IOException;
09:
10: public interface MimeHeaderHolder {
11:
12: /**
13: * A new header has been parsed.
14: * @param name The name of the encountered header.
15: * @param buf The byte buffer containing the value.
16: * @param off Offset of the header value in the above buffer.
17: * @param len Length of the value in the above header.
18: * @exception MimeParserException if the parsing failed
19: */
20:
21: public void notifyHeader(String name, byte buf[], int off, int len)
22: throws MimeParserException;
23:
24: /**
25: * The parsing is now about to start, take any appropriate action.
26: * This hook can return a <strong>true</strong> boolean value to enforce
27: * the MIME parser into transparent mode (eg the parser will <em>not</em>
28: * try to parse any headers.
29: * <p>This hack is primarily defined for HTTP/0.9 support, it might
30: * also be usefull for other hacks.
31: * @param parser The Mime parser.
32: * @return A boolean <strong>true</strong> if the MimeParser shouldn't
33: * continue the parsing, <strong>false</strong> otherwise.
34: * @exception MimeParserException if the parsing failed
35: * @exception IOException if an IO error occurs.
36: */
37:
38: public boolean notifyBeginParsing(MimeParser parser)
39: throws MimeParserException, IOException;
40:
41: /**
42: * All the headers have been parsed, take any appropriate actions.
43: * @param parser The Mime parser.
44: * @exception MimeParserException if the parsing failed
45: * @exception IOException if an IO error occurs.
46: */
47:
48: public void notifyEndParsing(MimeParser parser)
49: throws MimeParserException, IOException;
50:
51: }
|