org.walluck.oscar.handlers.filetransfer
Class FileHeader

java.lang.Object
  extended by org.walluck.oscar.handlers.filetransfer.FileHeader

public class FileHeader
extends Object

The gigantic file header.

Since:
1.0
Version:
1.0
Author:
David Walluck

Field Summary
static int FH_TYPE_FILE_DATA
          File data.
static int FH_TYPE_FILE_OK_TO_RESUME
          OK to resume file.
static int FH_TYPE_FILE_OK_TO_SEND
          OK to send file.
static int FH_TYPE_FILE_REQUEST
          Request file.
static int FH_TYPE_FILE_TO_RESUME
          File to resume.
static int FH_TYPE_FILE_TO_SEND
          File to send.
static int FH_TYPE_FILE_WANT_TO_RESUME
          Want resume.
static int FH_TYPE_FOOTER
          File footer.
static int FH_TYPE_LIST_DATA
          List data.
static int FH_TYPE_LIST_FOOTER
          List footer.
static int FH_TYPE_LIST_OK_TO_SEND
          OK to send list.
static int FH_TYPE_LIST_REQUEST
          Request directory listing.
static int FH_TYPE_LIST_TO_SEND
          List to send.
static byte FLAG_DEFAULT
          The default flag sent by WinAIM.
static byte FLAG_DONE
          The done flag.
static byte FLAG_FILE_LIST
          The file list flag.
 
Constructor Summary
FileHeader()
           
 
Method Summary
 int getCharset()
          Get the value of charset.
 int getCharSubset()
          Get the value of charSubset.
 long getChecksum()
          Get the value of checksum.
 int getCompression()
          Get the value of compression.
 byte[] getCookie()
          Get the value of cookie.
 byte[] getDummyBlock()
          Get the value of dummyBlock.
 int getEncryption()
          Get the value of encryption.
 long getFileSize()
          Get the value of fileSize.
 long getFileTime()
          Get the value of fileTime.
 byte getFlag()
          Get the value of flag.
 String getIDString()
          Get the value of id.
 int getLength()
          Get the value of length.
 byte getListNameOffset()
          Get the value of listNameOffset.
 byte getListSizeOffset()
          Get the value of listSizeOffset.
 byte[] getMacFileInfo()
          Get the value of macFileInfo.
 String getMagic()
          Get the value of magic.
 String getName()
          Get the value of name.
 int getNumFilesLeft()
          Get the value of numFilesLeft.
 int getNumPartsLeft()
          Get the value of numPartsLeft.
 long getNumRecvd()
          Get the value of numRecvd.
 long getRecvdChecksum()
          Get the value of recvdChecksum.
 long getResChecksum()
          Get the value of resChecksum.
 long getResRecvdChecksum()
          Get the value of resRecvdChecksum.
 long getResSize()
          Get the value of resSize.
 long getResTime()
          Get the value of resTime.
 long getTotalFileSize()
          Get the value of totalFileSize.
 int getTotalNumFiles()
          Get the value of totalNumFiles.
 int getTotalNumParts()
          Get the value of totalNumParts.
 int getType()
          Get the value of type.
 void setCharset(int charset)
          Set the value of charset.
 void setCharSubset(int charSubset)
          Set the value of charsubset.
 void setChecksum(long checksum)
          Set the value of checksum.
 void setComm(int length, int type)
          Set attributes common to both send file and receive file.
 void setCompression(int compression)
          Set the value of compression.
 void setCookie(byte[] cookie)
          Set the value of cookie.
 void setDummyBlock(byte[] dummyBlock)
          Set the value of dummyBlock.
 void setEncryption(int encryption)
          Set the value of encryption.
 void setFileSize(long fileSize)
          Set the value of fileSize.
 void setFileTime(long fileTime)
          Set the value of fileTime.
 void setFlag(byte flag)
          Set the value of flag.
 void setIDString(String id)
          Set the value of id.
 void setLength(int length)
          Set the value of length.
 void setListNameOffset(byte listNameOffset)
          Set the value of listNameOffset.
 void setListSizeOffset(byte listSizeOffset)
          Set the value of listSizeOffset.
 void setMacFileInfo(byte[] macFileInfo)
          Set the value of macFileInfo.
 void setMagic(String magic)
          Set the value of magic.
 void setName(String name)
          Set the value of name.
 void setNumFilesLeft(int numFilesLeft)
          Set the value of numFilesLeft.
 void setNumPartsLeft(int numPartsLeft)
          Set the value of numPartsLeft.
 void setNumRecvd(long numRecvd)
          Set the value of numRecvd.
 void setRecv(long numRecvd, long recvdChecksum)
          Set the receive file attributes.
 void setRecvdChecksum(long recvdChecksum)
          Set the value of recvdChecksum.
 void setRes(long resSize, long resTime, long resChecksum)
          Set resource fork (Macintosh) attributes.
 void setResChecksum(long resChecksum)
          Set the value of resChecksum.
 void setResRecvdChecksum(long resRecvdChecksum)
          Set the value of resRecvdChecksum.
 void setResSize(long resSize)
          Set the value of resSize.
 void setResTime(long resTime)
          Set the value of resTime.
 void setSend(int totalNumFiles, int numFilesLeft, int totalNumParts, int numPartsLeft, long totalFileSize, long fileSize, long fileTime, long checksum, String name)
          Set the send file attributes.
 void setTotalFileSize(long totalFileSize)
          Set the value of totalFileSize.
 void setTotalNumFiles(int totalNumFiles)
          Set the value of totalNumFiles.
 void setTotalNumParts(int totalNumParts)
          Set the value of totalNumParts.
 void setType(int type)
          Set the value of type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLAG_DEFAULT

public static final byte FLAG_DEFAULT
The default flag sent by WinAIM.

See Also:
Constant Field Values

FLAG_DONE

public static final byte FLAG_DONE
The done flag.

See Also:
Constant Field Values

FLAG_FILE_LIST

public static final byte FLAG_FILE_LIST
The file list flag.

See Also:
Constant Field Values

FH_TYPE_FILE_DATA

public static final int FH_TYPE_FILE_DATA
File data.

See Also:
Constant Field Values

FH_TYPE_FILE_TO_SEND

public static final int FH_TYPE_FILE_TO_SEND
File to send.

See Also:
Constant Field Values

FH_TYPE_FILE_TO_RESUME

public static final int FH_TYPE_FILE_TO_RESUME
File to resume.

See Also:
Constant Field Values

FH_TYPE_FILE_OK_TO_SEND

public static final int FH_TYPE_FILE_OK_TO_SEND
OK to send file.

See Also:
Constant Field Values

FH_TYPE_FOOTER

public static final int FH_TYPE_FOOTER
File footer.

See Also:
Constant Field Values

FH_TYPE_FILE_WANT_TO_RESUME

public static final int FH_TYPE_FILE_WANT_TO_RESUME
Want resume.

See Also:
Constant Field Values

FH_TYPE_FILE_OK_TO_RESUME

public static final int FH_TYPE_FILE_OK_TO_RESUME
OK to resume file.

See Also:
Constant Field Values

FH_TYPE_LIST_DATA

public static final int FH_TYPE_LIST_DATA
List data.

See Also:
Constant Field Values

FH_TYPE_LIST_TO_SEND

public static final int FH_TYPE_LIST_TO_SEND
List to send.

See Also:
Constant Field Values

FH_TYPE_LIST_OK_TO_SEND

public static final int FH_TYPE_LIST_OK_TO_SEND
OK to send list.

See Also:
Constant Field Values

FH_TYPE_LIST_FOOTER

public static final int FH_TYPE_LIST_FOOTER
List footer.

See Also:
Constant Field Values

FH_TYPE_FILE_REQUEST

public static final int FH_TYPE_FILE_REQUEST
Request file.

See Also:
Constant Field Values

FH_TYPE_LIST_REQUEST

public static final int FH_TYPE_LIST_REQUEST
Request directory listing.

See Also:
Constant Field Values
Constructor Detail

FileHeader

public FileHeader()
Method Detail

setSend

public void setSend(int totalNumFiles,
                    int numFilesLeft,
                    int totalNumParts,
                    int numPartsLeft,
                    long totalFileSize,
                    long fileSize,
                    long fileTime,
                    long checksum,
                    String name)
Set the send file attributes.

Parameters:
totalNumFiles - total number of files
numFilesLeft - number of files left to send
totalNumParts - total parts
numPartsLeft - total parts left
totalFileSize - total file size
fileSize - file size
fileTime - file time
checksum - file checksum
name - file name

setRecv

public void setRecv(long numRecvd,
                    long recvdChecksum)
Set the receive file attributes.

Parameters:
numRecvd - number of files received
recvdChecksum - checksum of the received file

setComm

public void setComm(int length,
                    int type)
Set attributes common to both send file and receive file.

Parameters:
length - the file header length
type - the file header type

setRes

public void setRes(long resSize,
                   long resTime,
                   long resChecksum)
Set resource fork (Macintosh) attributes.

Parameters:
resSize - resource fork size
resTime - resource fork timestamp
resChecksum - resource fork checksum

getMagic

public String getMagic()
Get the value of magic.

Returns:
value of magic.

setMagic

public void setMagic(String magic)
Set the value of magic.

Parameters:
magic - Value to assign to magic.

getLength

public int getLength()
Get the value of length.

Returns:
value of length.

setLength

public void setLength(int length)
Set the value of length.

Parameters:
length - Value to assign to length.

getType

public int getType()
Get the value of type.

Returns:
value of type.

setType

public void setType(int type)
Set the value of type.

Parameters:
type - Value to assign to type.

getCookie

public byte[] getCookie()
Get the value of cookie.

Returns:
value of cookie.

setCookie

public void setCookie(byte[] cookie)
Set the value of cookie.

Parameters:
cookie - Value to assign to cookie.

getEncryption

public int getEncryption()
Get the value of encryption.

Returns:
value of encryption.

setEncryption

public void setEncryption(int encryption)
Set the value of encryption.

Parameters:
encryption - Value to assign to encryption.

getCompression

public int getCompression()
Get the value of compression.

Returns:
value of compression.

setCompression

public void setCompression(int compression)
Set the value of compression.

Parameters:
compression - Value to assign to compression.

getTotalNumFiles

public int getTotalNumFiles()
Get the value of totalNumFiles.

Returns:
value of totalNumFiles.

setTotalNumFiles

public void setTotalNumFiles(int totalNumFiles)
Set the value of totalNumFiles.

Parameters:
totalNumFiles - Value to assign to totalNumFiles.

getNumFilesLeft

public int getNumFilesLeft()
Get the value of numFilesLeft.

Returns:
value of numFilesLeft.

setNumFilesLeft

public void setNumFilesLeft(int numFilesLeft)
Set the value of numFilesLeft.

Parameters:
numFilesLeft - Value to assign to numFilesLeft.

getTotalNumParts

public int getTotalNumParts()
Get the value of totalNumParts.

Returns:
value of totalNumParts.

setTotalNumParts

public void setTotalNumParts(int totalNumParts)
Set the value of totalNumParts.

Parameters:
totalNumParts - Value to assign to totalNumParts.

getNumPartsLeft

public int getNumPartsLeft()
Get the value of numPartsLeft.

Returns:
value of numPartsLeft.

setNumPartsLeft

public void setNumPartsLeft(int numPartsLeft)
Set the value of numPartsLeft.

Parameters:
numPartsLeft - Value to assign to numPartsLeft.

getTotalFileSize

public long getTotalFileSize()
Get the value of totalFileSize.

Returns:
value of totalFileSize.

setTotalFileSize

public void setTotalFileSize(long totalFileSize)
Set the value of totalFileSize.

Parameters:
totalFileSize - Value to assign to totalFileSize.

getFileSize

public long getFileSize()
Get the value of fileSize.

Returns:
value of fileSize.

setFileSize

public void setFileSize(long fileSize)
Set the value of fileSize.

Parameters:
fileSize - Value to assign to fileSize.

getFileTime

public long getFileTime()
Get the value of fileTime.

Returns:
value of fileTime.

setFileTime

public void setFileTime(long fileTime)
Set the value of fileTime.

Parameters:
fileTime - Value to assign to fileTime.

getChecksum

public long getChecksum()
Get the value of checksum.

Returns:
value of checksum.

setChecksum

public void setChecksum(long checksum)
Set the value of checksum.

Parameters:
checksum - Value to assign to checksum.

getResRecvdChecksum

public long getResRecvdChecksum()
Get the value of resRecvdChecksum.

Returns:
value of resRecvdChecksum.

setResRecvdChecksum

public void setResRecvdChecksum(long resRecvdChecksum)
Set the value of resRecvdChecksum.

Parameters:
resRecvdChecksum - Value to assign to resRecvdChecksum.

getResSize

public long getResSize()
Get the value of resSize.

Returns:
value of resSize.

setResSize

public void setResSize(long resSize)
Set the value of resSize.

Parameters:
resSize - Value to assign to resSize.

getResTime

public long getResTime()
Get the value of resTime.

Returns:
value of resTime.

setResTime

public void setResTime(long resTime)
Set the value of resTime.

Parameters:
resTime - Value to assign to resTime.

getResChecksum

public long getResChecksum()
Get the value of resChecksum.

Returns:
value of resChecksum.

setResChecksum

public void setResChecksum(long resChecksum)
Set the value of resChecksum.

Parameters:
resChecksum - Value to assign to resChecksum.

getNumRecvd

public long getNumRecvd()
Get the value of numRecvd.

Returns:
value of numRecvd.

setNumRecvd

public void setNumRecvd(long numRecvd)
Set the value of numRecvd.

Parameters:
numRecvd - Value to assign to numRecvd.

getRecvdChecksum

public long getRecvdChecksum()
Get the value of recvdChecksum.

Returns:
value of recvdChecksum.

setRecvdChecksum

public void setRecvdChecksum(long recvdChecksum)
Set the value of recvdChecksum.

Parameters:
recvdChecksum - Value to assign to recvdChecksum.

getIDString

public String getIDString()
Get the value of id.

Returns:
value of id.

setIDString

public void setIDString(String id)
Set the value of id.

Parameters:
id - Value to assign to id.

getFlag

public byte getFlag()
Get the value of flag.

Returns:
value of flag.

setFlag

public void setFlag(byte flag)
Set the value of flag.

Parameters:
flag - Value to assign to flag.

getListNameOffset

public byte getListNameOffset()
Get the value of listNameOffset.

Returns:
value of listNameOffset.

setListNameOffset

public void setListNameOffset(byte listNameOffset)
Set the value of listNameOffset.

Parameters:
listNameOffset - Value to assign to listNameOffset.

getListSizeOffset

public byte getListSizeOffset()
Get the value of listSizeOffset.

Returns:
value of listSizeOffset.

setListSizeOffset

public void setListSizeOffset(byte listSizeOffset)
Set the value of listSizeOffset.

Parameters:
listSizeOffset - Value to assign to listSizeOffset.

getDummyBlock

public byte[] getDummyBlock()
Get the value of dummyBlock.

Returns:
value of dummyBlock.

setDummyBlock

public void setDummyBlock(byte[] dummyBlock)
Set the value of dummyBlock.

Parameters:
dummyBlock - Value to assign to dummyBlock.

getMacFileInfo

public byte[] getMacFileInfo()
Get the value of macFileInfo.

Returns:
value of macFileInfo.

setMacFileInfo

public void setMacFileInfo(byte[] macFileInfo)
Set the value of macFileInfo.

Parameters:
macFileInfo - Value to assign to macFileInfo.

getCharset

public int getCharset()
Get the value of charset.

Returns:
value of charset.

setCharset

public void setCharset(int charset)
Set the value of charset.

Parameters:
charset - Value to assign to charset.

getCharSubset

public int getCharSubset()
Get the value of charSubset.

Returns:
value of charSubset.

setCharSubset

public void setCharSubset(int charSubset)
Set the value of charsubset.

Parameters:
charSubset - Value to assign to charsubset.

getName

public String getName()
Get the value of name.

Returns:
value of name.

setName

public void setName(String name)
Set the value of name.

Parameters:
name - Value to assign to name.