01: // PICS.java
02: // $Id: PICS.java,v 1.3 2000/08/16 21:37:43 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1998.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.pics;
07:
08: import org.w3c.www.http.HttpBag;
09: import org.w3c.www.http.HttpFactory;
10: import org.w3c.www.http.HttpMimeType;
11:
12: import org.w3c.www.mime.MimeType;
13: import org.w3c.www.mime.MimeTypeFormatException;
14:
15: /**
16: * @version $Revision: 1.3 $
17: * @author Benoît Mahé (bmahe@w3.org)
18: */
19: public class PICS {
20: /**
21: * The PICS protocol version that this filter handles.
22: */
23: public static final String PICS_PROTOCOL_ID = "PICS-1.1";
24:
25: /**
26: * The PICS mime type
27: */
28: public static HttpMimeType APPLICATION_PICSLABEL = null;
29:
30: /**
31: * The bag describing the PICS extension:
32: */
33: public static HttpBag PICS_EXTENSION = null;
34:
35: private static boolean debug = false;
36:
37: static {
38: try {
39: MimeType type = new MimeType("application/pics-label");
40: APPLICATION_PICSLABEL = HttpFactory.makeMimeType(type);
41: } catch (MimeTypeFormatException ex) {
42: ex.printStackTrace();
43: System.exit(1);
44: }
45:
46: HttpBag headers = HttpFactory.makeBag("headers");
47: headers.addItem("PICS-label");
48: PICS_EXTENSION = HttpFactory.makeBag(PICS.PICS_PROTOCOL_ID);
49: PICS_EXTENSION.addBag(headers);
50:
51: }
52:
53: public static boolean debug() {
54: return debug;
55: }
56:
57: public static void setDebug(boolean onoff) {
58: debug = onoff;
59: }
60:
61: }
|