1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.archive.io;
24
25 /***
26 * Constants used by Archive files and in Archive file processing.
27 * @author stack
28 * @version $Date: 2006-09-12 19:41:23 +0000 (Tue, 12 Sep 2006) $ $Revision: 4620 $
29 */
30 public interface ArchiveFileConstants {
31 /***
32 * Suffix given to files currently in use.
33 */
34 public static final String OCCUPIED_SUFFIX = ".open";
35
36 /***
37 * Suffix appended to 'broken' files.
38 */
39 public static final String INVALID_SUFFIX = ".invalid";
40
41 /***
42 * Compressed file extention.
43 */
44 public static final String COMPRESSED_FILE_EXTENSION = "gz";
45
46 /***
47 * Dot plus compressed file extention.
48 */
49 public static final String DOT_COMPRESSED_FILE_EXTENSION = "." +
50 COMPRESSED_FILE_EXTENSION;
51
52 /***
53 * Key for the Archive File version field.
54 */
55 public static final String VERSION_FIELD_KEY = "version";
56
57 /***
58 * Key for the Archive File length field.
59 */
60 public static final String LENGTH_FIELD_KEY = "length";
61
62 /***
63 * Key for the Archive File type field.
64 */
65 public static final String TYPE_FIELD_KEY = "type";
66
67 /***
68 * Key for the Archive File URL field.
69 */
70 public static final String URL_FIELD_KEY = "subject-uri";
71
72 /***
73 * Key for the Archive File Creation Date field.
74 */
75 public static final String DATE_FIELD_KEY = "creation-date";
76
77 /***
78 * Key for the Archive File mimetype field.
79 */
80 public static final String MIMETYPE_FIELD_KEY = "content-type";
81
82 /***
83 * Key for the Archive File record field.
84 */
85 public static final String RECORD_IDENTIFIER_FIELD_KEY =
86 "record-identifier";
87
88 /***
89 * Key for the Archive Record absolute offset into Archive file.
90 */
91 public static final String ABSOLUTE_OFFSET_KEY = "absolute-offset";
92
93 public static final String READER_IDENTIFIER_FIELD_KEY =
94 "reader-identifier";
95
96 /***
97 * Size used to preallocate stringbuffer used outputting a cdx line.
98 * The numbers below are guesses at sizes of each of the cdx fields.
99 * The ones in the below are spaces. Here is the legend used outputting
100 * the cdx line: CDX b e a m s c V n g. Consult cdx documentation on
101 * meaning of each of these fields.
102 */
103 public static final int CDX_LINE_BUFFER_SIZE = 14 + 1 + 15 + 1 + 1024 +
104 1 + 24 + 1 + + 3 + 1 + 32 + 1 + 20 + 1 + 20 + 1 + 64;
105
106 public static final String DEFAULT_DIGEST_METHOD = "SHA-1";
107
108 public static final char SINGLE_SPACE = ' ';
109
110 public static final String CRLF = "\r\n";
111
112 public static final String CDX = "cdx";
113 public static final String DUMP = "dump";
114 public static final String GZIP_DUMP = "gzipdump";
115 public static final String HEADER = "header";
116 public static final String NOHEAD = "nohead";
117 public static final String CDX_FILE = "cdxfile";
118 }