Debian Codegraph @

src/main/java/org/apache/commons/compress/archivers/cpio/CpioConstants.java

raw
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19 package org.apache.commons.compress.archivers.cpio;
20
21 /**
22 * All constants needed by CPIO.
23 *
24 * based on code from the jRPM project (jrpm.sourceforge.net)
25 *
26 * http://www.opengroup.org/onlinepubs/9699919799/basedefs/cpio.h.html has a list of the C_xxx constants.
27 */
28 public interface CpioConstants {
29 /** Magic number of a cpio entry in the new format */
30 String MAGIC_NEW = "070701";
31
32 /** Magic number of a cpio entry in the new format with crc */
33 String MAGIC_NEW_CRC = "070702";
34
35 /** Magic number of a cpio entry in the old ascii format */
36 String MAGIC_OLD_ASCII = "070707";
37
38 /** Magic number of a cpio entry in the old binary format */
39 int MAGIC_OLD_BINARY = 070707;
40
41 /** Write/read a CpioArchiveEntry in the new format. FORMAT_ constants are internal. */
42 short FORMAT_NEW = 1;
43
44 /** Write/read a CpioArchiveEntry in the new format with crc. FORMAT_ constants are internal. */
45 short FORMAT_NEW_CRC = 2;
46
47 /** Write/read a CpioArchiveEntry in the old ascii format. FORMAT_ constants are internal. */
48 short FORMAT_OLD_ASCII = 4;
49
50 /** Write/read a CpioArchiveEntry in the old binary format. FORMAT_ constants are internal. */
51 short FORMAT_OLD_BINARY = 8;
52
53 /** Mask for both new formats. FORMAT_ constants are internal. */
54 short FORMAT_NEW_MASK = 3;
55
56 /** Mask for both old formats. FORMAT_ constants are internal. */
57 short FORMAT_OLD_MASK = 12;
58
59 /*
60 * Constants for the MODE bits
61 */
62
63 /** Mask for all file type bits. */
64 int S_IFMT = 0170000;
65
66 /** Defines a socket */
67 int C_ISSOCK = 0140000;
68
69 /** Defines a symbolic link */
70 int C_ISLNK = 0120000;
71
72 /** HP/UX network special (C_ISCTG) */
73 int C_ISNWK = 0110000;
74
75 /** Defines a regular file */
76 int C_ISREG = 0100000;
77
78 /** Defines a block device */
79 int C_ISBLK = 0060000;
80
81 /** Defines a directory */
82 int C_ISDIR = 0040000;
83
84 /** Defines a character device */
85 int C_ISCHR = 0020000;
86
87 /** Defines a pipe */
88 int C_ISFIFO = 0010000;
89
90 /** Sets user ID */
91 int C_ISUID = 0004000;
92
93 /** Sets group ID */
94 int C_ISGID = 0002000;
95
96 /** On directories, restricted deletion flag. */
97 int C_ISVTX = 0001000;
98
99 /** Permits the owner of a file to read the file */
100 int C_IRUSR = 0000400;
101
102 /** Permits the owner of a file to write to the file */
103 int C_IWUSR = 0000200;
104
105 /** Permits the owner of a file to execute the file or to search the directory */
106 int C_IXUSR = 0000100;
107
108 /** Permits a file's group to read the file */
109 int C_IRGRP = 0000040;
110
111 /** Permits a file's group to write to the file */
112 int C_IWGRP = 0000020;
113
114 /** Permits a file's group to execute the file or to search the directory */
115 int C_IXGRP = 0000010;
116
117 /** Permits others to read the file */
118 int C_IROTH = 0000004;
119
120 /** Permits others to write to the file */
121 int C_IWOTH = 0000002;
122
123 /** Permits others to execute the file or to search the directory */
124 int C_IXOTH = 0000001;
125
126 /** The special trailer marker */
127 String CPIO_TRAILER = "TRAILER!!!";
128
129 /**
130 * The default block size.
131 *
132 * @since 1.1
133 */
134 int BLOCK_SIZE = 512;
135 }