Module org.hsqldb

Enum TarHeaderField

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TarHeaderField>

    public enum TarHeaderField
    extends java.lang.Enum<TarHeaderField>
    Purely static structure defining our interface to the Tar Entry Header. The fields controlled here are fields for the individual tar file entries in an archive. There is no such thing as a Header Field at the top archive level.

    We use header field names as they are specified in the FreeBSD man page for tar in section 5 (Solaris and Linux have no such page in section 5). Where we use a constant, the constant name is just the FreeBSD field name capitalized. Since a single field is known as either "linkflag" or "typeflag", we are going with the UStar name typeflag for this field.

    We purposefully define no variable for this list of fields, since we DO NOT WANT TO access or change these values, due to application goals or JVM limitations:

    • gid
    • uid
    • linkname
    • magic (UStar ID),
    • magic version
    • group name
    • device major num
    • device minor num
    Our application has no use for these, or Java has no ability to work with them.

    This class will be very elegant when refactored as an enum with enumMap(s) and using generics with auto-boxing instead of the ugly and non-validating casts.

    Author:
    Blaine Simpson (blaine dot simpson at admc dot com)
    • Method Detail

      • values

        public static TarHeaderField[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TarHeaderField c : TarHeaderField.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TarHeaderField valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getStart

        public int getStart()
      • getStop

        public int getStop()