|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IFileSession
Represents a file transfer session between two clients.
Method Summary | |
---|---|
void |
accept()
Accepts an incoming file and initiates the transfer. |
void |
addFileSessionListener(IFileSessionListener listener)
Registers a file session listener to receive events from this file session. |
void |
cancel(String reason)
Cancels an outgoing file invitation. |
void |
decline(String reason)
Declines an incoming file. |
void |
disconnect()
Disconnects this file session. |
IClient |
getClient()
Returns the client this session is associated with. |
File |
getCurrentFile()
Returns the current file being transfered. |
long |
getCurrentFileProgress()
Returns the number of bytes transfered so far in the current file. |
long |
getCurrentFileSize()
Returns the size of the current file being transfered. |
String |
getDescription()
Returns a description of the file being transfered. |
String |
getFileName()
Returns the name of the file being transfered. |
long |
getFileSize()
Returns the total size of all files being transfered. |
int |
getNumberOfFiles()
Returns the number of files being transfered. |
String |
getRecipient()
Returns the name of the user receiving this file. |
File |
getSaveToDirectory()
Returns the directory where incoming files will be saved. |
String |
getSender()
Returns the name of the user sending this file. |
void |
invite()
Invites the recipient to this file session. |
boolean |
isConnected()
Returns true if this session is connected. |
boolean |
isIncoming()
Returns true if this session is incoming, ie: the client is receiving the file. |
boolean |
isOutgoing()
Returns true if this session is outgoing, ie: the client is sending the file. |
boolean |
isProgressThreadEnabled()
Returns true if the progress thread is enabled. |
void |
removeFileSessionListener(IFileSessionListener listener)
Stops a file session listener from receiving events from this file session. |
void |
setDescription(String s)
Sets a description of the file being transfered. |
void |
setPortRange(int min,
int max)
Sets a range of ports which can be used to serve this session. |
void |
setProgressThreadEnabled(boolean b)
Sets whether the progress thread is enabled. |
void |
setSaveToDirectory(File file)
Sets the directory where incoming files will be saved. |
Method Detail |
---|
void accept() throws IOException
IOException
- if isIncoming() == false, or there was
a problem communicating to the servervoid addFileSessionListener(IFileSessionListener listener)
void cancel(String reason) throws IOException
IOException
- if isOutgoing() == false, or there was
a problem communicating to the servervoid decline(String reason) throws IOException
IOException
- if isIncoming() == false, or there was
a problem communicating to the servervoid disconnect()
IClient getClient()
File getCurrentFile()
long getCurrentFileProgress()
long getCurrentFileSize()
String getDescription()
String getFileName()
long getFileSize()
int getNumberOfFiles()
String getRecipient()
File getSaveToDirectory()
String getSender()
void invite() throws IOException
IOException
- if isOutgoing() == false, or there was
a problem communicating to the serverboolean isConnected()
boolean isIncoming()
boolean isOutgoing()
boolean isProgressThreadEnabled()
void removeFileSessionListener(IFileSessionListener listener)
void setDescription(String s)
void setPortRange(int min, int max)
void setProgressThreadEnabled(boolean b)
void setSaveToDirectory(File file) throws IOException
IOException
- if isIncoming() == false, or file is not
a directory
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |