|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.walluck.oscar.handlers.filetransfer.FileTransfer
File transfer code. Oscar File transfer (OFT) and Oscar Direct Connect (ODC). (ODC is also referred to as DirectIM and IM Image.) There are a few static helper functions at the top, then ODC stuff, then ft stuff. I feel like this is a good place to explain OFT, so I'm going to do just that. Each OFT packet has a header type. I guess this is pretty similar to the subtype of a SNAC packet. The type basically tells the other client the meaning of the OFT packet. There are two distinct types of file transfer, which I usually call "sendfile" and "getfile." Sendfile is when you send a file to another AIM user. Getfile is when you share a group of files, and other users request that you send them the files. A typical sendfile file transfer goes like this:
Constructor Summary | |
FileTransfer(AIMSession sess)
Creates a new FileTransfer. |
Method Summary | |
static long |
calculateChecksum(java.lang.String name,
long start,
long stop)
Calculate the checksum for a file with the given name. |
void |
getFileAccept(byte[] cookie,
byte[] rCookie,
java.lang.String screenname,
java.lang.String remoteIPAddress,
int remotePort)
Accept a get getfile. |
void |
getFileCancel(byte[] cookie,
byte[] rCookie,
java.lang.String screenname,
java.lang.String remoteIPAddress,
int remotePort)
Cancel a getfile. |
void |
getFileRequest(byte[] cookie,
java.lang.String screenname)
Request a getfile. |
void |
removeTransfer(byte[] rCookie)
Remove a file transfer. |
void |
sendFileAccept(byte[] cookie,
byte[] rCookie,
java.lang.String screenname,
java.lang.String remoteIPAddress,
int remotePort)
Accept a file. |
void |
sendFileCancel(byte[] cookie,
byte[] rCookie,
java.lang.String screenname,
java.lang.String remoteIPAddress,
int remotePort)
Cancel a file. |
void |
sendFileRequest(byte[] cookie,
java.lang.String screenname,
int type,
int fileCount,
int dirSize,
java.lang.String fileName,
java.lang.String message)
Send a file transfer request. |
void |
setWantResponse(boolean wantResponse)
Set the value of wantResponse. |
boolean |
wantResponse()
Get the value of wantResponse. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileTransfer(AIMSession sess)
sess
- the oscar sessionMethod Detail |
public static long calculateChecksum(java.lang.String name, long start, long stop) throws java.io.IOException
name
- the file namestart
- the byte to start atstop
- the byte to stop at
java.io.IOException
- if an error occurspublic void getFileRequest(byte[] cookie, java.lang.String screenname)
cookie
- the cookiescreenname
- the screennamepublic void getFileAccept(byte[] cookie, byte[] rCookie, java.lang.String screenname, java.lang.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, java.lang.String screenname, java.lang.String remoteIPAddress, int remotePort)
cookie
- the cookierCookie
- the remote cookiescreenname
- the screennameremoteIPAddress
- the remote IP addressremotePort
- the remote portpublic void sendFileRequest(byte[] cookie, java.lang.String screenname, int type, int fileCount, int dirSize, java.lang.String fileName, java.lang.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, java.lang.String screenname, java.lang.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, java.lang.String screenname, java.lang.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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |