|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.walluck.oscar.handlers.filetransfer.FileTransfer
public class 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(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. |
| 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 session| Method Detail |
|---|
public static long calculateChecksum(String name,
long start,
long stop)
throws IOException
name - the file namestart - the byte to start atstop - the byte to stop at
IOException - if an error occurs
public void getFileRequest(byte[] cookie,
String screenname)
cookie - the cookiescreenname - the screenname
public 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 port
public 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 port
public 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 message
public 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 port
public 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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||