org.at4j.zip.extattrs
Enum UnixEntityType

java.lang.Object
  extended by java.lang.Enum<UnixEntityType>
      extended by org.at4j.zip.extattrs.UnixEntityType
All Implemented Interfaces:
Serializable, Comparable<UnixEntityType>

public enum UnixEntityType
extends Enum<UnixEntityType>

An enumeration over the different Unix entity types that may occur in a Zip file. This is used by the UnixExternalFileAttributes.

Since:
1.0
Author:
Karl Gustafsson
See Also:
UnixExternalFileAttributes

Enum Constant Summary
BLOCK_SPECIAL
           
CHARACTER_SPECIAL
           
DIRECTORY
           
PIPE
           
REGULAR_FILE
           
SOCKET
           
SYMBOLIC_LINK
           
 
Method Summary
static UnixEntityType forCode(int code)
          Get the Unix entity type corresponding to the code.
 byte getCode()
          Get the code for this entity type.
 String toString()
           
static UnixEntityType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static UnixEntityType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

REGULAR_FILE

public static final UnixEntityType REGULAR_FILE

DIRECTORY

public static final UnixEntityType DIRECTORY

SYMBOLIC_LINK

public static final UnixEntityType SYMBOLIC_LINK

BLOCK_SPECIAL

public static final UnixEntityType BLOCK_SPECIAL

CHARACTER_SPECIAL

public static final UnixEntityType CHARACTER_SPECIAL

PIPE

public static final UnixEntityType PIPE

SOCKET

public static final UnixEntityType SOCKET
Method Detail

values

public static UnixEntityType[] 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 (UnixEntityType c : UnixEntityType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static UnixEntityType valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

forCode

public static UnixEntityType forCode(int code)
                              throws IllegalArgumentException
Get the Unix entity type corresponding to the code.

The entity types are (codes in octal representation):

Parameters:
code - The code for the entity type.
Returns:
The entity type.
Throws:
IllegalArgumentException - If the code is unknown.

getCode

public byte getCode()
Get the code for this entity type.

Returns:
The code for this entity type.
See Also:
forCode(int)

toString

public String toString()
Overrides:
toString in class Enum<UnixEntityType>