public class FileModel
extends java.lang.Object
Contains data and information used by the Handler. This may include information such as filename, filesize, current transfer file size, current status, etc. Default class is basically an empty class that contains no data.
Just as a note, the current filesize acts as both the current file transferred size and also as the initial resume offset before transfer begins.
| Constructor and Description |
|---|
FileModel(java.lang.String filename) |
FileModel(java.lang.String filename,
long resumeOffset) |
FileModel(java.lang.String filename,
java.lang.String saveLocation) |
FileModel(java.lang.String filename,
java.lang.String saveLocation,
long resumeOffset) |
FileModel(java.lang.String filename,
java.lang.String saveLocation,
long resumeOffset,
TransferRateThrottler throttler) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
the objects are equal if filename, filesize, and savelocation are equal.
|
long |
getCurrentFilesize()
Obtains the current filesize
|
java.lang.String |
getFilename() |
long |
getFilesize() |
java.lang.String |
getSaveLocation() |
TransferRateThrottler |
getThrottler() |
java.lang.String |
getTimeLeft() |
long |
getTransferBPS() |
float |
getTransferKBPS() |
void |
incrementCurrentFilesize(long increment)
increments the current filesize by a specified amount
|
void |
reset()
Resets all the data fields back to the initial state.
|
void |
setCurrentFilesize(long currentFilesize)
Sets the CURRENT filesize or resume offset depending on whether
you are sending or receiving a file
|
void |
setEndTime(long endTime)
Sets the end time when the transfer is finished
|
void |
setFilename(java.lang.String filename)
sets the filename you want to retrieve
|
void |
setFilesize(long filesize)
Sets the filesize or resume offset depending on whether
you are sending or receiving a file
|
void |
setSaveLocation(java.lang.String saveLocation)
sets the location on where to save the file.
|
void |
setStartTime(long startTime)
Sets the start time when the transfer begins
|
void |
setThrottler(TransferRateThrottler throttler)
sets the transfer rate throttler to use for throttling the transfer rate
|
public FileModel(java.lang.String filename)
filename - the name of the file to requestpublic FileModel(java.lang.String filename,
long resumeOffset)
filename - the name of the file to requestresumeOffset - the filesize from where to resumepublic FileModel(java.lang.String filename,
java.lang.String saveLocation)
filename - the name of the file to requestsaveLocation - the location (path + filename) to store the file locallypublic FileModel(java.lang.String filename,
java.lang.String saveLocation,
long resumeOffset)
filename - the name of the file to requestsaveLocation - the location (path + filename) to store the file locallyresumeOffset - the filesize from where to resumepublic FileModel(java.lang.String filename,
java.lang.String saveLocation,
long resumeOffset,
TransferRateThrottler throttler)
filename - the name of the file to requestsaveLocation - the location (path + filename) to store the file locallyresumeOffset - the filesize from where to resumethrottler - the throttler, null if no throttling is donepublic java.lang.String getFilename()
public void setFilename(java.lang.String filename)
public long getFilesize()
public void setFilesize(long filesize)
public void setCurrentFilesize(long currentFilesize)
public long getCurrentFilesize()
public void incrementCurrentFilesize(long increment)
public java.lang.String getSaveLocation()
public void setSaveLocation(java.lang.String saveLocation)
public void setStartTime(long startTime)
public float getTransferKBPS()
public long getTransferBPS()
public java.lang.String getTimeLeft()
public void reset()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic void setEndTime(long endTime)
public void setThrottler(TransferRateThrottler throttler)
public TransferRateThrottler getThrottler()
Copyright © 2001-2005 Echomine. All Rights Reserved.