net.kano.joscar.rvproto.getfile
Class GetFileList

java.lang.Object
  extended byGetFileList
All Implemented Interfaces:
LiveWritable

public class GetFileList
extends java.lang.Object
implements LiveWritable

A data structure representing a "Get File" directory listing. Note that a Get File list may contain only the files and directories in one directory or all files a directory and in all subdirectories, recursively. See GetFileReqRvCmd.FLAG_EXPAND_DYNAMIC for details.


Field Summary
static java.lang.String GFLISTVERSION_DEFAULT
          The Get File directory listing version string used by WinAIM.
 
Constructor Summary
GetFileList(GetFileEntry[] files)
          Creates a new Get File directory list with the given list of files.
GetFileList(java.lang.String gfListVersion, GetFileEntry[] files)
          Creates a new Get File directory listing with the given list version string and the given list of files.
 
Method Summary
 GetFileEntry[] getFileEntries()
          Returns an array containing the Get File entries in this list.
 java.lang.String getGfListVersion()
          Returns the Get File listing version string used in this list.
static GetFileList readGetFileList(ByteBlock block)
          Reads a Get File directory list from the given block of binary data.
 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

GFLISTVERSION_DEFAULT

public static final java.lang.String GFLISTVERSION_DEFAULT
The Get File directory listing version string used by WinAIM.

See Also:
Constant Field Values
Constructor Detail

GetFileList

public GetFileList(GetFileEntry[] files)
Creates a new Get File directory list with the given list of files.

Using this constructor is equivalent to using new GetFileList(GFLISTVERSION_DEFAULT, files.

Parameters:
files - a list of files to use in this list

GetFileList

public GetFileList(java.lang.String gfListVersion,
                   GetFileEntry[] files)
Creates a new Get File directory listing with the given list version string and the given list of files. Note that the given file list may not contain any null elements.

Parameters:
gfListVersion - a Get File list version string; this should normally be GFLISTVERSION_DEFAULT
files - a list of files to hold in this list
Method Detail

readGetFileList

public static GetFileList readGetFileList(ByteBlock block)
Reads a Get File directory list from the given block of binary data. Note that this method will return null if no valid list can be read. The given block should be the entire block of data sent following a FileTransferHeader.HEADERTYPE_FILELIST_SENDLIST header.

Parameters:
block - a block of data containing a Get File directory listing
Returns:
a Get File directory listing object read from the given block

getGfListVersion

public final java.lang.String getGfListVersion()
Returns the Get File listing version string used in this list. This will normally be GFLISTVERSION_DEFAULT.

Returns:
the Get Fle listing version string sent in this list

getFileEntries

public final GetFileEntry[] getFileEntries()
Returns an array containing the Get File entries in this list. Note that changes to the returned array will not be reflected in this file list object.

Returns:
an array containing the Get File entries in this list

write

public final void write(java.io.OutputStream out)
                 throws java.io.IOException
Description copied from interface: LiveWritable
Writes a representation of this object to the given stream.

Specified by:
write in interface LiveWritable
Parameters:
out - the stream to which to write
Throws:
java.io.IOException - if an I/O error occurs

toString

public java.lang.String toString()