001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.commons.vfs.provider.tar;
018:
019: /**
020: * This interface contains all the definitions used in the package.
021: *
022: * @author <a href="mailto:time@ice.com">Timothy Gerard Endres</a>
023: * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
024: * @version $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $
025: */
026: interface TarConstants {
027: /**
028: * The length of the mode field in a header buffer.
029: */
030: int MODELEN = 8;
031:
032: /**
033: * The length of the user id field in a header buffer.
034: */
035: int UIDLEN = 8;
036:
037: /**
038: * The length of the group id field in a header buffer.
039: */
040: int GIDLEN = 8;
041:
042: /**
043: * The length of the checksum field in a header buffer.
044: */
045: int CHKSUMLEN = 8;
046:
047: /**
048: * The length of the size field in a header buffer.
049: */
050: int SIZELEN = 12;
051:
052: /**
053: * The length of the magic field in a header buffer.
054: */
055: int MAGICLEN = 8;
056:
057: /**
058: * The length of the modification time field in a header buffer.
059: */
060: int MODTIMELEN = 12;
061:
062: /**
063: * The length of the user name field in a header buffer.
064: */
065: int UNAMELEN = 32;
066:
067: /**
068: * The length of the group name field in a header buffer.
069: */
070: int GNAMELEN = 32;
071:
072: /**
073: * The length of the devices field in a header buffer.
074: */
075: int DEVLEN = 8;
076:
077: /**
078: * LF_ constants represent the "link flag" of an entry, or more commonly,
079: * the "entry type". This is the "old way" of indicating a normal file.
080: */
081: byte LF_OLDNORM = 0;
082:
083: /**
084: * Normal file type.
085: */
086: byte LF_NORMAL = (byte) '0';
087:
088: /**
089: * Link file type.
090: */
091: byte LF_LINK = (byte) '1';
092:
093: /**
094: * Symbolic link file type.
095: */
096: byte LF_SYMLINK = (byte) '2';
097:
098: /**
099: * Character device file type.
100: */
101: byte LF_CHR = (byte) '3';
102:
103: /**
104: * Block device file type.
105: */
106: byte LF_BLK = (byte) '4';
107:
108: /**
109: * Directory file type.
110: */
111: byte LF_DIR = (byte) '5';
112:
113: /**
114: * FIFO (pipe) file type.
115: */
116: byte LF_FIFO = (byte) '6';
117:
118: /**
119: * Contiguous file type.
120: */
121: byte LF_CONTIG = (byte) '7';
122:
123: /**
124: * The magic tag representing a POSIX tar archive.
125: */
126: String TMAGIC = "ustar";
127:
128: /**
129: * The magic tag representing a GNU tar archive.
130: */
131: String GNU_TMAGIC = "ustar ";
132:
133: /**
134: * The namr of the GNU tar entry which contains a long name.
135: */
136: String GNU_LONGLINK = "././@LongLink";
137:
138: /**
139: * Identifies the *next* file on the tape as having a long name.
140: */
141: byte LF_GNUTYPE_LONGNAME = (byte) 'L';
142: }
|