public interface FileTransferMonitor
extends java.lang.Runnable
FileTransferListener
objects that listen to transfer events fired by
this monitor.Modifier and Type | Method and Description |
---|---|
void |
addListener(FileTransferListener listener)
Adds a listener object to respond to transfer events
|
void |
fireCompleteEvent(org.apache.commons.vfs2.FileObject destFile)
Convenience function for firing a "complete" event for the transfer
|
void |
fireEvent(FileTransferEvent event)
Fires the supplied event to all listeners associated with this monitor
|
void |
fireStartEvent(org.apache.commons.vfs2.FileObject destFile)
Convenience function for firing a "start" event for the transfer
|
FileTransferListener[] |
getListeners() |
long |
getPollSleep()
Time in milliseconds between polls when checking for an update
in the transfer status.
|
void |
monitor(org.apache.commons.vfs2.FileObject destFile,
org.apache.commons.vfs2.FileObject srcFile)
Informs this monitor object to monitor a file transfer.
|
void |
monitor(org.apache.commons.vfs2.FileObject destFile,
org.apache.commons.vfs2.FileObject srcFile,
long size,
java.lang.String displayName)
Informs this monitor object to monitor a file transfer.
|
void |
monitor(org.apache.commons.vfs2.FileObject destFile,
long size)
Informs this monitor object to monitor a file transfer.
|
void |
release(org.apache.commons.vfs2.FileObject destFile)
Discontinues monitoring a file transfer based on the supplied
destination file.
|
void |
removeListener(FileTransferListener listener)
Removes a listener object
|
void |
setPollSleep(long period)
Sets the polling period
|
void |
start()
Starts the monitoring thread
|
void |
stop()
Stops the monitoring thread
|
void addListener(FileTransferListener listener)
listener
- listener to addvoid removeListener(FileTransferListener listener)
listener
- listener to removeFileTransferListener[] getListeners()
long getPollSleep()
void setPollSleep(long period)
void fireEvent(FileTransferEvent event)
void fireStartEvent(org.apache.commons.vfs2.FileObject destFile)
destFile
- The destination file for the transfer to uniquely
identify the FileTransferMonitorAgent responsible for firing eventsvoid fireCompleteEvent(org.apache.commons.vfs2.FileObject destFile)
destFile
- The destination file for the transfer to uniquely
identify the FileTransferMonitorAgent responsible for firing eventsvoid monitor(org.apache.commons.vfs2.FileObject destFile, org.apache.commons.vfs2.FileObject srcFile)
destFile
- transfer destinationsrcFile
- transfer sourcevoid monitor(org.apache.commons.vfs2.FileObject destFile, org.apache.commons.vfs2.FileObject srcFile, long size, java.lang.String displayName)
destFile
- transfer destinationsrcFile
- transfer sourcesize
- the size of the source file (total transfer size). If < 0, then we determine
the transfer size from srcFiledisplayName
- the name associated with the transfer (may be different than
destFile if .part is used)void monitor(org.apache.commons.vfs2.FileObject destFile, long size)
destFile
- transfer destinationsize
- Total transfer sizevoid release(org.apache.commons.vfs2.FileObject destFile)
destFile
- destination filevoid start()
void stop()