org.sonatype.aether.util.listener
Class DefaultTransferResource

java.lang.Object
  extended by org.sonatype.aether.util.listener.DefaultTransferResource
All Implemented Interfaces:
TransferResource

public class DefaultTransferResource
extends Object
implements TransferResource

A simple transfer resource.

Author:
Benjamin Bentmann

Constructor Summary
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.
 
Method Summary
 long getContentLength()
           
 File getFile()
           
 String getRepositoryUrl()
           
 String getResourceName()
           
 RequestTrace getTrace()
           
 long getTransferStartTime()
           
 DefaultTransferResource setContentLength(long contentLength)
          Sets the size of the resource in bytes.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultTransferResource

@Deprecated
public DefaultTransferResource(String repositoryUrl,
                                          String resourceName,
                                          File file)
Deprecated. As of version 1.11, use DefaultTransferResource(String, String, File, RequestTrace) instead.

Creates a new transfer resource with the specified properties.

Parameters:
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.

DefaultTransferResource

public DefaultTransferResource(String repositoryUrl,
                               String resourceName,
                               File file,
                               RequestTrace trace)
Creates a new transfer resource with the specified properties.

Parameters:
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.
Method Detail

getRepositoryUrl

public String getRepositoryUrl()
Specified by:
getRepositoryUrl in interface TransferResource

getResourceName

public String getResourceName()
Specified by:
getResourceName in interface TransferResource

getFile

public File getFile()
Specified by:
getFile in interface TransferResource

getContentLength

public long getContentLength()
Specified by:
getContentLength in interface TransferResource

setContentLength

public DefaultTransferResource setContentLength(long contentLength)
Sets 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.

getTransferStartTime

public long getTransferStartTime()
Specified by:
getTransferStartTime in interface TransferResource

getTrace

public RequestTrace getTrace()
Specified by:
getTrace in interface TransferResource

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.