- java.lang.Object
-
- java.lang.Enum<TarHeaderField>
-
- org.hsqldb.lib.tar.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
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getStart()
int
getStop()
static TarHeaderField
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TarHeaderField[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
name
public static final TarHeaderField name
-
mode
public static final TarHeaderField mode
-
uid
public static final TarHeaderField uid
-
gid
public static final TarHeaderField gid
-
size
public static final TarHeaderField size
-
mtime
public static final TarHeaderField mtime
-
checksum
public static final TarHeaderField checksum
-
typeflag
public static final TarHeaderField typeflag
-
magic
public static final TarHeaderField magic
-
uname
public static final TarHeaderField uname
-
gname
public static final TarHeaderField gname
-
prefix
public static final TarHeaderField prefix
-
-
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 namejava.lang.NullPointerException
- if the argument is null
-
getStart
public int getStart()
-
getStop
public int getStop()
-
-