public final class TransferResource extends Object
Constructor and Description |
---|
TransferResource(String repositoryUrl,
String resourceName,
File file,
RequestTrace trace)
Deprecated.
|
TransferResource(String repositoryId,
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 |
getRepositoryId()
The ID of the repository, e.g., "central".
|
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.
|
long |
getResumeOffset()
Gets the byte offset within the resource from which the download starts.
|
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.
|
TransferResource |
setContentLength(long contentLength)
Sets the size of the resource in bytes.
|
TransferResource |
setResumeOffset(long resumeOffset)
Sets the byte offset within the resource at which the download starts.
|
String |
toString() |
@Deprecated public TransferResource(String repositoryUrl, String resourceName, File file, RequestTrace trace)
TransferResource(java.lang.String, java.lang.String,
java.lang.String, java.io.File, org.eclipse.aether.RequestTrace)
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 TransferResource(String repositoryId, String repositoryUrl, String resourceName, File file, RequestTrace trace)
repositoryId
- The ID of the repository used to transfer the resource, may be null
or
empty if unknown.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 getRepositoryId()
null
.public String getRepositoryUrl()
null
.public String getResourceName()
null
.public File getFile()
null
if none.public long getContentLength()
started
.public TransferResource setContentLength(long contentLength)
contentLength
- The size of the resource in bytes or a negative value if unknown.null
.public long getResumeOffset()
0
means the transfer starts at the first byte.public TransferResource setResumeOffset(long resumeOffset)
resumeOffset
- The zero-based index of the first byte being transferred, must not be negative.null
.public long getTransferStartTime()
public RequestTrace getTrace()
null
if none.Copyright © 2010–2020 The Apache Software Foundation. All rights reserved.