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