public class FileTransferEvent
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FileTransferEvent.Type
Event types
|
Constructor and Description |
---|
FileTransferEvent(org.apache.commons.vfs2.FileObject source,
org.apache.commons.vfs2.FileObject dest,
FileTransferEvent.Type type,
long sourceSize,
long destSize,
long destTime,
java.lang.String displayName)
Constructor, sets properties of event and automatically computes
the event's time from the system clock.
|
Modifier and Type | Method and Description |
---|---|
org.apache.commons.vfs2.FileObject |
getDestinationFile() |
long |
getDestinationSize() |
java.lang.String |
getDisplayName()
Returns the display name.
|
long |
getEventTime()
Returns the system time in milliseconds that the event
was created.
|
double |
getProgress()
Fractional progress, -1 if cannot be determined
|
org.apache.commons.vfs2.FileObject |
getSourceFile() |
long |
getSourceSize() |
long |
getTransferTime() |
FileTransferEvent.Type |
getType() |
void |
notify(FileTransferListener listener)
Fires the event to all listeners
|
public FileTransferEvent(org.apache.commons.vfs2.FileObject source, org.apache.commons.vfs2.FileObject dest, FileTransferEvent.Type type, long sourceSize, long destSize, long destTime, java.lang.String displayName)
source
- The source filedest
- Transfer destinationtype
- Type of eventsourceSize
- Size of file to transferdestSize
- Current size of the destination filedestTime
- Current timestamp on the destination filedisplayName
- Can be used to display file, for example in case
an intermediary file is used such as file.txt.part, you may want
to display file.txt instead.public void notify(FileTransferListener listener)
listener
- public org.apache.commons.vfs2.FileObject getSourceFile()
public org.apache.commons.vfs2.FileObject getDestinationFile()
public FileTransferEvent.Type getType()
public long getDestinationSize()
public long getSourceSize()
public long getTransferTime()
public double getProgress()
public long getEventTime()
public java.lang.String getDisplayName()