public class FileTransfer extends Object
Constructor and Description |
---|
FileTransfer(AIMSession sess)
Creates a new FileTransfer.
|
Modifier and Type | Method and Description |
---|---|
static long |
calculateChecksum(String name,
long start,
long stop)
Calculate the checksum for a file with the given name.
|
void |
getFileAccept(byte[] cookie,
byte[] rCookie,
String screenname,
String remoteIPAddress,
int remotePort)
Accept a get getfile.
|
void |
getFileCancel(byte[] cookie,
byte[] rCookie,
String screenname,
String remoteIPAddress,
int remotePort)
Cancel a getfile.
|
void |
getFileRequest(byte[] cookie,
String screenname)
Request a getfile.
|
void |
removeTransfer(byte[] rCookie)
Remove a file transfer.
|
void |
sendFileAccept(byte[] cookie,
byte[] rCookie,
String screenname,
String remoteIPAddress,
int remotePort)
Accept a file.
|
void |
sendFileCancel(byte[] cookie,
byte[] rCookie,
String screenname,
String remoteIPAddress,
int remotePort)
Cancel a file.
|
void |
sendFileRequest(byte[] cookie,
String screenname,
int type,
int fileCount,
int dirSize,
String fileName,
String message)
Send a file transfer request.
|
void |
setWantResponse(boolean wantResponse)
Set the value of wantResponse.
|
boolean |
wantResponse()
Get the value of wantResponse.
|
public FileTransfer(AIMSession sess)
sess
- the oscar sessionpublic static long calculateChecksum(String name, long start, long stop) throws IOException
name
- the file namestart
- the byte to start atstop
- the byte to stop atIOException
- if an error occurspublic void getFileRequest(byte[] cookie, String screenname)
cookie
- the cookiescreenname
- the screennamepublic void getFileAccept(byte[] cookie, byte[] rCookie, String screenname, String remoteIPAddress, int remotePort)
cookie
- the cookierCookie
- the remote cookiescreenname
- the screennameremoteIPAddress
- the remote IP addressremotePort
- the remote portpublic void getFileCancel(byte[] cookie, byte[] rCookie, String screenname, String remoteIPAddress, int remotePort)
cookie
- the cookierCookie
- the remote cookiescreenname
- the screennameremoteIPAddress
- the remote IP addressremotePort
- the remote portpublic void sendFileRequest(byte[] cookie, String screenname, int type, int fileCount, int dirSize, String fileName, String message)
cookie
- the cookiescreenname
- the screennametype
- the typefileCount
- the file countdirSize
- the directory sizefileName
- the file (or directoy) namemessage
- the messagepublic void sendFileAccept(byte[] cookie, byte[] rCookie, String screenname, String remoteIPAddress, int remotePort)
cookie
- the cookierCookie
- the remote cookiescreenname
- the screennameremoteIPAddress
- the remote IP addressremotePort
- the remote portpublic void sendFileCancel(byte[] cookie, byte[] rCookie, String screenname, String remoteIPAddress, int remotePort)
cookie
- the cookierCookie
- the remote cookiescreenname
- the screennameremoteIPAddress
- the remote IP addressremotePort
- the remote portpublic void removeTransfer(byte[] rCookie)
rCookie
- the cookiepublic boolean wantResponse()
public void setWantResponse(boolean wantResponse)
wantResponse
- Value to assign to wantResponse.