Package org.eclipse.aether.transfer
Class TransferResource
java.lang.Object
org.eclipse.aether.transfer.TransferResource
Describes a resource being uploaded or downloaded by the repository system.
- 
Constructor SummaryConstructorsConstructorDescriptionTransferResource(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.
- 
Method SummaryModifier and TypeMethodDescriptionlongThe size of the resource in bytes.getFile()Gets the local file being uploaded or downloaded.The ID of the repository, e.g., "central".The base URL of the repository, e.g.The path of the resource relative to the repository's base URL, e.g.longGets the byte offset within the resource from which the download starts.getTrace()Gets the trace information that describes the higher level request/operation during which this resource is transferred.longGets the timestamp when the transfer of this resource was started.setContentLength(long contentLength) Sets the size of the resource in bytes.setResumeOffset(long resumeOffset) Sets the byte offset within the resource at which the download starts.toString()
- 
Constructor Details- 
TransferResource@Deprecated public TransferResource(String repositoryUrl, String resourceName, File file, RequestTrace trace) Deprecated.Creates a new transfer resource with the specified properties.- Parameters:
- repositoryUrl- The base URL of the repository, may be- nullor 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.
 
- 
TransferResourcepublic TransferResource(String repositoryId, String repositoryUrl, String resourceName, File file, RequestTrace trace) Creates a new transfer resource with the specified properties.- Parameters:
- repositoryId- The ID of the repository used to transfer the resource, may be- nullor empty if unknown.
- repositoryUrl- The base URL of the repository, may be- nullor 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.
- Since:
- 1.1.0
 
 
- 
- 
Method Details- 
getRepositoryIdThe ID of the repository, e.g., "central".- Returns:
- The ID of the repository or an empty string if unknown, never null.
- Since:
- 1.1.0
 
- 
getRepositoryUrlThe base URL of the repository, e.g. "http://repo1.maven.org/maven2/". Unless the URL is unknown, it will be terminated by a trailing slash.- Returns:
- The base URL of the repository or an empty string if unknown, never null.
 
- 
getResourceNameThe path of the resource relative to the repository's base URL, e.g. "org/apache/maven/maven/3.0/maven-3.0.pom".- Returns:
- The path of the resource, never null.
 
- 
getFileGets the local file being uploaded or downloaded. When the repository system merely checks for the existence of a remote resource, no local file will be involved in the transfer.- Returns:
- The source/target file involved in the transfer or nullif none.
 
- 
getContentLengthThe size of the resource in bytes. Note that the size of a resource during downloads might be unknown to the client which is usually the case when transfers employ compression like gzip. In general, the content length is not known until the transfer hasstarted.- Returns:
- The size of the resource in bytes or a negative value if unknown.
 
- 
setContentLengthSets the size of the resource in bytes.- Parameters:
- contentLength- The size of the resource in bytes or a negative value if unknown.
- Returns:
- This resource for chaining, never null.
 
- 
getResumeOffsetGets the byte offset within the resource from which the download starts. A positive offset indicates a previous download attempt is being resumed,0means the transfer starts at the first byte.- Returns:
- The zero-based index of the first byte being transferred, never negative.
 
- 
setResumeOffsetSets the byte offset within the resource at which the download starts.- Parameters:
- resumeOffset- The zero-based index of the first byte being transferred, must not be negative.
- Returns:
- This resource for chaining, never null.
 
- 
getTransferStartTimeGets the timestamp when the transfer of this resource was started.- Returns:
- The timestamp when the transfer of this resource was started.
 
- 
getTraceGets the trace information that describes the higher level request/operation during which this resource is transferred.- Returns:
- The trace information about the higher level operation or nullif none.
 
- 
toString
 
- 
TransferResource(java.lang.String, java.lang.String, java.lang.String, java.io.File, org.eclipse.aether.RequestTrace)