Class Entry
java.lang.Object
com.twelvemonkeys.io.ole2.Entry
- All Implemented Interfaces:
Comparable<Entry>
Represents an OLE 2 compound document entry.
This is similar to a file in a file system, or an entry in a ZIP or JAR file.
- Version:
- $Id: //depot/branches/personal/haraldk/twelvemonkeys/release-2/twelvemonkeys-core/src/main/java/com/twelvemonkeys/io/ole2/Entry.java#4 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) long(package private) CompoundDocument(package private) static final intstatic final int(package private) static final int(package private) long(package private) String(package private) int(package private) byte(package private) Entry(package private) int(package private) static final int(package private) static final int(package private) int(package private) int(package private) int(package private) byte(package private) static final int(package private) static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongcreated()Returns the time that this entry was created.booleanReturns the children of thisEntry.getChildEntry(String pName) Returns the child of thisEntrywith the given name.Returns theInputStreamfor thisEntrygetName()Returns the name of thisEntryReturn the parent of thisEntryinthashCode()booleanIftruethisEntryis a directoryEntry.booleanisFile()IftruethisEntryis a file (document)Entry.booleanisRoot()IftruethisEntryis the rootEntry.longReturns the time that this entry was last modified.longlength()Returns the length of this entryprivate voidReads this entry(package private) static EntryReads an entry from the input.toString()
-
Field Details
-
name
String name -
type
byte type -
nodeColor
byte nodeColor -
prevDId
int prevDId -
nextDId
int nextDId -
rootNodeDId
int rootNodeDId -
createdTimestamp
long createdTimestamp -
modifiedTimestamp
long modifiedTimestamp -
startSId
int startSId -
streamSize
int streamSize -
document
CompoundDocument document -
parent
Entry parent -
children
-
LENGTH
public static final int LENGTH- See Also:
-
EMPTY
static final int EMPTY- See Also:
-
USER_STORAGE
static final int USER_STORAGE- See Also:
-
USER_STREAM
static final int USER_STREAM- See Also:
-
LOCK_BYTES
static final int LOCK_BYTES- See Also:
-
PROPERTY
static final int PROPERTY- See Also:
-
ROOT_STORAGE
static final int ROOT_STORAGE- See Also:
-
NO_CHILDREN
-
-
Constructor Details
-
Entry
private Entry()
-
-
Method Details
-
readEntry
Reads an entry from the input.- Parameters:
pInput- the input data- Returns:
- the
Entryread from the input data - Throws:
IOException- if an i/o exception occurs during reading
-
read
Reads this entry- Parameters:
pInput- the input data- Throws:
IOException- if an i/o exception occurs during reading
-
isRoot
public boolean isRoot()IftruethisEntryis the rootEntry.- Returns:
trueif this is the rootEntry
-
isDirectory
public boolean isDirectory()IftruethisEntryis a directoryEntry.- Returns:
trueif this is a directoryEntry
-
isFile
public boolean isFile()IftruethisEntryis a file (document)Entry.- Returns:
trueif this is a documentEntry
-
getName
-
getInputStream
Returns theInputStreamfor thisEntry- Returns:
- an
InputStreamcontaining the data for thisEntryornullif this is a directoryEntry - Throws:
IOException- if an I/O exception occurs- See Also:
-
length
public long length()Returns the length of this entry- Returns:
- the length of the stream for this entry, or
0if this is a directoryEntry - See Also:
-
created
public long created()Returns the time that this entry was created. The time is converted from its internal representation to standard Java representation, milliseconds since the epoch (00:00:00 GMT, January 1, 1970).Note that most applications leaves this value empty (
0L).- Returns:
- A
longvalue representing the time this entry was created, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or0Lif no creation time stamp exists for this entry.
-
lastModified
public long lastModified()Returns the time that this entry was last modified. The time is converted from its internal representation to standard Java representation, milliseconds since the epoch (00:00:00 GMT, January 1, 1970).Note that many applications leaves this value empty (
0L).- Returns:
- A
longvalue representing the time this entry was last modified, measured in milliseconds since the epoch (00:00:00 GMT, January 1, 1970), or0Lif no modification time stamp exists for this entry.
-
getParentEntry
Return the parent of thisEntry- Returns:
- the parent of this
Entry, ornullif this is the rootEntry
-
getChildEntry
Returns the child of thisEntrywith the given name.- Parameters:
pName- the name of the childEntry- Returns:
- the child
Entryornullif thee is no such child - Throws:
IOException- if an I/O exception occurs
-
getChildEntries
Returns the children of thisEntry.- Returns:
- a
SortedSetofEntryobjects - Throws:
IOException- if an I/O exception occurs
-
toString
-
equals
-
hashCode
-
compareTo
- Specified by:
compareToin interfaceComparable<Entry>
-