public class TransferInfo extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
STATE_ABORTED
State when transfer was aborted by sending or receiving user.
|
static String |
STATE_CANCELLING
State when cancel was requested.
|
static String |
STATE_COMPLETED
State when transfer was successful.
|
static String |
STATE_ERROR
State when transfer was stopped due to e.g. network error.
|
static String |
STATE_REJECTED
State when transfer was rejected by receiver.
|
static String |
STATE_TRANSFERRING
State when transfer is in progress.
|
static String |
STATE_WAITING
State waiting for acceptance.
|
Constructor and Description |
---|
TransferInfo()
Create a new file transfer info.
|
TransferInfo(boolean download,
String id,
String filename,
String filepath,
IComponentIdentifier other,
long size,
long timeout)
Create a new file transfer info.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Test for equality.
|
long |
getDone()
Get the done.
|
String |
getFileName()
Get the name of the local file (without path).
|
String |
getFilePath()
Get the full path of the local file (including filename).
|
String |
getId()
Get the id.
|
IComponentIdentifier |
getOther()
Get the opposite component.
|
long |
getSize()
Get the size.
|
double |
getSpeed()
Get the speed.
|
String |
getState()
Get the state.
|
long |
getTimeout()
Get the timeout.
|
int |
hashCode()
Get the hash code.
|
boolean |
isDownload()
Check if transfer is a download or upload.
|
boolean |
isFinished()
Check if transfer is finished.
|
void |
setDone(long done)
Set the done.
|
void |
setDownload(boolean download)
Set the transfer as a download or upload.
|
void |
setFileName(String filename)
Set the name of the local file (without path).
|
void |
setFilePath(String filepath)
Set the full path of the local file (including filename).
|
void |
setId(String id)
Set the id.
|
void |
setOther(IComponentIdentifier other)
Set the opposite component.
|
void |
setSize(long size)
Set the size.
|
void |
setSpeed(double speed)
Set the speed.
|
void |
setState(String state)
Set the state.
|
void |
setTimeout(long timeout)
Set the timeout.
|
boolean |
update(long done)
Update the transfer info.
|
public static final String STATE_WAITING
public static final String STATE_REJECTED
public static final String STATE_TRANSFERRING
public static final String STATE_CANCELLING
public static final String STATE_COMPLETED
public static final String STATE_ABORTED
public static final String STATE_ERROR
public TransferInfo()
public TransferInfo(boolean download, String id, String filename, String filepath, IComponentIdentifier other, long size, long timeout)
public String getFileName()
public void setFileName(String filename)
filename
- The file name to set.public String getFilePath()
public void setFilePath(String filepath)
filepath
- The file pathto set.public IComponentIdentifier getOther()
public void setOther(IComponentIdentifier other)
other
- The CID to set.public long getSize()
public void setSize(long size)
size
- The size to set.public long getTimeout()
public void setTimeout(long timeout)
timeout
- The absolute timeout value to set.public long getDone()
public void setDone(long done)
done
- The done to set.public boolean update(long done)
done
- The done to set.public String getId()
public void setId(String id)
public String getState()
public boolean isDownload()
public void setDownload(boolean download)
public double getSpeed()
public void setSpeed(double speed)
public void setState(String state)
state
- The state to set.public boolean isFinished()
Copyright © 2013. All Rights Reserved.