View Javadoc

1   /*
2    * jGuild Project: jRPM
3    * Released under the Apache License ( http://www.apache.org/LICENSE )
4    */
5   package com.jguild.jrpm.io.cpio;
6   
7   /***
8    * All constants needed by CPIO.
9    *
10   * @author Michael Kuss
11   */
12  public interface CPIOConstants {
13      /*** magic number of a cpio entry in the new format */
14      public static final String MAGIC_NEW = "070701";
15      /*** magic number of a cpio entry in the new format with crc */
16      public static final String MAGIC_NEW_CRC = "070702";
17      /*** magic number of a cpio entry in the old ascii format */
18      public static final String MAGIC_OLD_ASCII = "070707";
19      /*** magic number of a cpio entry in the old binary format */
20      public static final int MAGIC_OLD_BINARY = 070707;
21  
22      /*** write/read a CPIOEntry in the new format */
23      public static final short FORMAT_NEW = 1;
24      /*** write/read a CPIOEntry in the new format with crc */
25      public static final short FORMAT_NEW_CRC = 2;
26      /*** write/read a CPIOEntry in the old ascii format */
27      public static final short FORMAT_OLD_ASCII = 4;
28      /*** write/read a CPIOEntry in the old binary format */
29      public static final short FORMAT_OLD_BINARY = 8;
30      /*** Mask for both new formats */
31      public static final short FORMAT_NEW_MASK = 3;
32      /*** Mask for both old formats */
33      public static final short FORMAT_OLD_MASK = 12;
34  
35      /*** Mask for all file type bits.  */
36      public static final int S_IFMT = 0170000;
37      /*** Defines a directory */
38      public static final int C_ISDIR = 0040000;
39      /*** Defines a symbolic link */
40      public static final int C_ISLNK = 0120000;
41      /*** Defines a regular file */
42      public static final int C_ISREG = 0100000;
43      /*** Defines a pipe */
44      public static final int C_ISFIFO = 0010000;
45      /*** Defines a character device */
46      public static final int C_ISCHR = 0020000;
47      /*** Defines a block device */
48      public static final int C_ISBLK = 0060000;
49      /*** Defines a socket */
50      public static final int C_ISSOCK = 0140000;
51      /*** HP/UX network special (C_ISCTG)*/
52      public static final int C_ISNWK = 0110000;
53      /*** Permits the owner of a file to read the file */
54      public static final int C_IRUSR = 000400;
55      /*** Permits the owner of a file to write to the file */
56      public static final int C_IWUSR = 000200;
57      /*** Permits the owner of a file to execute the file or to search the file's directory */
58      public static final int C_IXUSR = 000100;
59      /*** Permits a file's group to read the file */
60      public static final int C_IRGRP = 000040;
61      /*** Permits a file's group to write to the file */
62      public static final int C_IWGRP = 000020;
63      /*** Permits a file's group to execute the file or to search the file's directory */
64      public static final int C_IXGRP = 000010;
65      /*** Permits others to read the file */
66      public static final int C_IROTH = 000004;
67      /*** Permits others to write to the file */
68      public static final int C_IWOTH = 000002;
69      /*** Permits others to execute the file or to search the file's directory */
70      public static final int C_IXOTH = 000001;
71  
72      public static final int C_ISUID = 004000;
73      public static final int C_ISGID = 002000;
74      public static final int C_ISVTX = 001000;
75  }