| 
 | Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.smackx.filetransfer.FileTransfer
public abstract class FileTransfer
Contains the generic file information and progress related to a particular file transfer.
| Nested Class Summary | |
|---|---|
| static class | FileTransfer.Error | 
| static class | FileTransfer.StatusA class to represent the current status of the file transfer. | 
| Field Summary | |
|---|---|
| protected  long | amountWritten | 
| protected  FileTransferNegotiator | negotiator | 
| protected  String | streamID | 
| Constructor Summary | |
|---|---|
| protected  | FileTransfer(String peer,
             String streamID,
             FileTransferNegotiator negotiator) | 
| Method Summary | |
|---|---|
| abstract  void | cancel()Cancels the file transfer. | 
|  long | getAmountWritten()Return the length of bytes written out to the stream. | 
|  FileTransfer.Error | getError()When getStatus()returns that there was anFileTransfer.Status.errorduring the transfer, the type of error can be retrieved through this
 method. | 
|  Exception | getException()If an exception occurs asynchronously it will be stored for later retrieval. | 
|  String | getFileName()Returns the name of the file being transfered. | 
|  String | getFilePath()Returns the local path of the file. | 
|  long | getFileSize()Returns the size of the file being transfered. | 
|  String | getPeer()Returns the JID of the peer for this file transfer. | 
|  double | getProgress()Returns the progress of the file transfer as a number between 0 and 1. | 
|  FileTransfer.Status | getStatus()Returns the current status of the file transfer. | 
|  String | getStreamID() | 
|  boolean | isDone()Returns true if the transfer has been cancelled, if it has stopped because of a an error, or the transfer completed successfully. | 
| protected  void | setError(FileTransfer.Error type) | 
| protected  void | setException(Exception exception) | 
| protected  void | setFileInfo(String fileName,
            long fileSize) | 
| protected  void | setFileInfo(String path,
            String fileName,
            long fileSize) | 
| protected  void | setStatus(FileTransfer.Status status) | 
| protected  boolean | updateStatus(FileTransfer.Status oldStatus,
             FileTransfer.Status newStatus) | 
| protected  void | writeToStream(InputStream in,
              OutputStream out) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected FileTransferNegotiator negotiator
protected String streamID
protected long amountWritten
| Constructor Detail | 
|---|
protected FileTransfer(String peer,
                       String streamID,
                       FileTransferNegotiator negotiator)
| Method Detail | 
|---|
protected void setFileInfo(String fileName,
                           long fileSize)
protected void setFileInfo(String path,
                           String fileName,
                           long fileSize)
public long getFileSize()
public String getFileName()
public String getFilePath()
public String getPeer()
public double getProgress()
public boolean isDone()
public FileTransfer.Status getStatus()
protected void setError(FileTransfer.Error type)
public FileTransfer.Error getError()
getStatus() returns that there was an FileTransfer.Status.error
 during the transfer, the type of error can be retrieved through this
 method.
public Exception getException()
getError()public String getStreamID()
public abstract void cancel()
protected void setException(Exception exception)
protected void setStatus(FileTransfer.Status status)
protected boolean updateStatus(FileTransfer.Status oldStatus,
                               FileTransfer.Status newStatus)
protected void writeToStream(InputStream in,
                             OutputStream out)
                      throws XMPPException
XMPPExceptionpublic long getAmountWritten()
| 
 | Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||