|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGetFileEntry
A data structure representing a single file or directory in a "Get File" directory listing.
Field Summary | |
static long |
FLAG_DIR
A flag indicating that a file entry is a directory. |
Constructor Summary | |
GetFileEntry(java.io.File file)
Creates a new Get File directory listing entry with the properties of the given file. |
|
GetFileEntry(SegmentedFilename filename,
java.io.File file)
Creates a new Get File directory listing entry with the properties of the given file and with the given name. |
|
GetFileEntry(SegmentedFilename filename,
long filesize,
long lastmod,
long flags)
Creates a new Get File directory list entry with the given properties. |
Method Summary | |
SegmentedFilename |
getFilename()
Returns the filename in this directory listing entry, or null if none is present. |
long |
getFileSize()
Returns the file size in this directory listing entry, or -1
if none is present. |
long |
getFlags()
Returns a the set of flags in this directory listing entry. |
long |
getLastmod()
Returns the last modification date in this directory listing entry, in seconds since the unix epoch. |
int |
getTotalTlvCount()
Returns the total number of TLV's read in constructing this entry object. |
static GetFileEntry |
readEntry(Tlv[] tlvs,
int offset)
Reads a Get File directory list entry from the given list of TLV's. |
java.lang.String |
toString()
|
void |
write(java.io.OutputStream out)
Writes a representation of this object to the given stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long FLAG_DIR
Constructor Detail |
public GetFileEntry(java.io.File file)
new
GetFileEntry(SegmentedFilename.fromNativeFilename(file.getName()),
file)
.
file
- the file whose properties should be used in this entrypublic GetFileEntry(SegmentedFilename filename, java.io.File file)
new
GetFileEntry(filename, file.lastModified() / 1000,
file.isDirectory() ? FLAG_DIR : 0)
.
filename
- a filename to use in this entryfile
- a file whose properties will be used for this entrypublic GetFileEntry(SegmentedFilename filename, long filesize, long lastmod, long flags)
null
or
-1
(depending on argument type) to indicate that that
field should not be present in the created entry.
filename
- the name of the filefilesize
- the size of the filelastmod
- the last modification date of the file, in seconds since
the unix epochflags
- a set of bit flags describing this file, like FLAG_DIR
or 0
Method Detail |
public static final GetFileEntry readEntry(Tlv[] tlvs, int offset)
GetFileEntry
's getTotalTlvCount()
method.
tlvs
- a list of TLV's containing a Get File directory list entryoffset
- the index of the first TLV in the given array from which
the file entry TLV's should be read
public final SegmentedFilename getFilename()
null
if none is present.
public final long getFileSize()
-1
if none is present.
public final long getLastmod()
-1
if no last modification date was sent.
public final long getFlags()
FLAG_DIR
or 0
. Note that this
value will never be -1
; if no flags are sent, this
value will simply be 0
.
public final int getTotalTlvCount()
-1
if this object was not read
from an incoming block of TLV's (with readEntry(net.kano.joscar.tlv.Tlv[], int)
).
public void write(java.io.OutputStream out) throws java.io.IOException
LiveWritable
write
in interface LiveWritable
out
- the stream to which to write
java.io.IOException
- if an I/O error occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |