public class DefaultTransferResource extends Object implements TransferResource
Constructor and Description |
---|
DefaultTransferResource(String repositoryUrl,
String resourceName,
File file)
Deprecated.
As of version 1.11, use
DefaultTransferResource(String, String, File, RequestTrace) instead. |
DefaultTransferResource(String repositoryUrl,
String resourceName,
File file,
RequestTrace trace)
Creates a new transfer resource with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
long |
getContentLength()
The size of the resource in bytes.
|
File |
getFile()
Gets the local file being uploaded or downloaded.
|
String |
getRepositoryUrl()
The base URL of the repository, e.g.
|
String |
getResourceName()
The path of the resource relative to the repository's base URL, e.g.
|
RequestTrace |
getTrace()
Gets the trace information that describes the higher level request/operation during which this resource is
transferred.
|
long |
getTransferStartTime()
Gets the timestamp when the transfer of this resource was started.
|
DefaultTransferResource |
setContentLength(long contentLength)
Sets the size of the resource in bytes.
|
String |
toString() |
@Deprecated public DefaultTransferResource(String repositoryUrl, String resourceName, File file)
DefaultTransferResource(String, String, File, RequestTrace)
instead.repositoryUrl
- The base URL of the repository, may be null
or empty if unknown. If not empty, a
trailing slash will automatically be added if missing.resourceName
- The relative path to the resource within the repository, may be null
. A leading slash
(if any) will be automatically removed.file
- The source/target file involved in the transfer, may be null
.public DefaultTransferResource(String repositoryUrl, String resourceName, File file, RequestTrace trace)
repositoryUrl
- The base URL of the repository, may be null
or empty if unknown. If not empty, a
trailing slash will automatically be added if missing.resourceName
- The relative path to the resource within the repository, may be null
. A leading slash
(if any) will be automatically removed.file
- The source/target file involved in the transfer, may be null
.trace
- The trace information, may be null
.public String getRepositoryUrl()
TransferResource
getRepositoryUrl
in interface TransferResource
null
.public String getResourceName()
TransferResource
getResourceName
in interface TransferResource
null
.public File getFile()
TransferResource
getFile
in interface TransferResource
null
if none.public long getContentLength()
TransferResource
started
.getContentLength
in interface TransferResource
public DefaultTransferResource setContentLength(long contentLength)
contentLength
- The size of the resource in bytes or a negative value if unknown.null
.public long getTransferStartTime()
TransferResource
getTransferStartTime
in interface TransferResource
public RequestTrace getTrace()
TransferResource
getTrace
in interface TransferResource
null
if none.Copyright © 2010-2012 Sonatype, Inc.. All Rights Reserved.