View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.vfs.provider.tar;
18  
19  /***
20   * This interface contains all the definitions used in the package.
21   *
22   * @author <a href="mailto:time@ice.com">Timothy Gerard Endres</a>
23   * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
24   * @version $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
25   */
26  interface TarConstants
27  {
28      /***
29       * The length of the mode field in a header buffer.
30       */
31      int MODELEN = 8;
32  
33      /***
34       * The length of the user id field in a header buffer.
35       */
36      int UIDLEN = 8;
37  
38      /***
39       * The length of the group id field in a header buffer.
40       */
41      int GIDLEN = 8;
42  
43      /***
44       * The length of the checksum field in a header buffer.
45       */
46      int CHKSUMLEN = 8;
47  
48      /***
49       * The length of the size field in a header buffer.
50       */
51      int SIZELEN = 12;
52  
53      /***
54       * The length of the magic field in a header buffer.
55       */
56      int MAGICLEN = 8;
57  
58      /***
59       * The length of the modification time field in a header buffer.
60       */
61      int MODTIMELEN = 12;
62  
63      /***
64       * The length of the user name field in a header buffer.
65       */
66      int UNAMELEN = 32;
67  
68      /***
69       * The length of the group name field in a header buffer.
70       */
71      int GNAMELEN = 32;
72  
73      /***
74       * The length of the devices field in a header buffer.
75       */
76      int DEVLEN = 8;
77  
78      /***
79       * LF_ constants represent the "link flag" of an entry, or more commonly,
80       * the "entry type". This is the "old way" of indicating a normal file.
81       */
82      byte LF_OLDNORM = 0;
83  
84      /***
85       * Normal file type.
86       */
87      byte LF_NORMAL = (byte)'0';
88  
89      /***
90       * Link file type.
91       */
92      byte LF_LINK = (byte)'1';
93  
94      /***
95       * Symbolic link file type.
96       */
97      byte LF_SYMLINK = (byte)'2';
98  
99      /***
100      * Character device file type.
101      */
102     byte LF_CHR = (byte)'3';
103 
104     /***
105      * Block device file type.
106      */
107     byte LF_BLK = (byte)'4';
108 
109     /***
110      * Directory file type.
111      */
112     byte LF_DIR = (byte)'5';
113 
114     /***
115      * FIFO (pipe) file type.
116      */
117     byte LF_FIFO = (byte)'6';
118 
119     /***
120      * Contiguous file type.
121      */
122     byte LF_CONTIG = (byte)'7';
123 
124     /***
125      * The magic tag representing a POSIX tar archive.
126      */
127     String TMAGIC = "ustar";
128 
129     /***
130      * The magic tag representing a GNU tar archive.
131      */
132     String GNU_TMAGIC = "ustar  ";
133 
134     /***
135      * The namr of the GNU tar entry which contains a long name.
136      */
137     String GNU_LONGLINK = "././@LongLink";
138 
139     /***
140      * Identifies the *next* file on the tape as having a long name.
141      */
142     byte LF_GNUTYPE_LONGNAME = (byte)'L';
143 }