Package org.jboss.vfs
Enum VirtualJarFileInputStream.State
- java.lang.Object
-
- java.lang.Enum<VirtualJarFileInputStream.State>
-
- org.jboss.vfs.VirtualJarFileInputStream.State
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<VirtualJarFileInputStream.State>
- Enclosing class:
- VirtualJarFileInputStream
private static enum VirtualJarFileInputStream.State extends java.lang.Enum<VirtualJarFileInputStream.State>
Basic state machine that will allow the process to transition between the different process states. The following describes the process flow: [NOT_STARTED] - Initial state - Does not provide content - Transitions [LOCAL_ENTRY_HEADER] [LOCAL_ENTRY_HEADER] - The phase for reading the Local Directory Header - Provides content of the local directory header by populating and feeding off a buffer - Transitions to [ENTRY_CONTENT] if the header was written - Transitions to [START_CENTRAL_DIRECTORY] if this is the last local entry header [ENTRY_CONTENT] - The phase for reading the content of an entry - Provides content of the entry using the VirtualJarInputStream - Transitions to [LOCAL_ENTRY_HEADER] [START_CENTRAL_DIRECTORY] - Phased used to transition into the central directory - Does not provide content - Transitions to [CENTRAL_ENTRY_HEADER] [CENTRAL_ENTRY_HEADER] - The phase for reading the content of a single central directory header - Provides content for the central directory header by feeding off a buffer - Transitions to [CENTRAL_ENTRY_HEADER] - Transitions to [CENTRAL_END] if there are no more entries [CENTRAL_END] - The phase for reading the contents of the central directory end - Provides content for central directory end by feeing off a buffer - Transitions to NULL to terminate the processing
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CENTRAL_END
CENTRAL_ENTRY_HEADER
ENTRY_CONTENT
LOCAL_ENTRY_HEADER
NOT_STARTED
START_CENTRAL_DIRECTORY
-
Constructor Summary
Constructors Modifier Constructor Description private
State()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) VirtualJarFileInputStream.State
getNextState(VirtualJarFileInputStream jarFileInputStream)
(package private) void
init(VirtualJarFileInputStream jarFileInputStream)
(package private) int
read(VirtualJarFileInputStream jarFileInputStream)
(package private) abstract VirtualJarFileInputStream.State
transition(VirtualJarFileInputStream virtualJarFileInputStream)
static VirtualJarFileInputStream.State
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static VirtualJarFileInputStream.State[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NOT_STARTED
public static final VirtualJarFileInputStream.State NOT_STARTED
-
LOCAL_ENTRY_HEADER
public static final VirtualJarFileInputStream.State LOCAL_ENTRY_HEADER
-
ENTRY_CONTENT
public static final VirtualJarFileInputStream.State ENTRY_CONTENT
-
START_CENTRAL_DIRECTORY
public static final VirtualJarFileInputStream.State START_CENTRAL_DIRECTORY
-
CENTRAL_ENTRY_HEADER
public static final VirtualJarFileInputStream.State CENTRAL_ENTRY_HEADER
-
CENTRAL_END
public static final VirtualJarFileInputStream.State CENTRAL_END
-
-
Method Detail
-
values
public static VirtualJarFileInputStream.State[] 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 (VirtualJarFileInputStream.State c : VirtualJarFileInputStream.State.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static VirtualJarFileInputStream.State 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
-
init
void init(VirtualJarFileInputStream jarFileInputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
transition
abstract VirtualJarFileInputStream.State transition(VirtualJarFileInputStream virtualJarFileInputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
read
int read(VirtualJarFileInputStream jarFileInputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
getNextState
VirtualJarFileInputStream.State getNextState(VirtualJarFileInputStream jarFileInputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
-