org.apache.maven.wagon

Interface Wagon

public interface Wagon

Field Summary
StringROLE
Method Summary
voidaddSessionListener(SessionListener listener)
voidaddTransferListener(TransferListener listener)
voidconnect(Repository source)
voidconnect(Repository source, ProxyInfo proxyInfo)
voidconnect(Repository source, AuthenticationInfo authenticationInfo)
voidconnect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo)
voiddisconnect()
voidget(String resourceName, File destination)
Downloads specified resource from the repository to given file.
ListgetFileList(String destinationDirectory)

Returns a List of strings naming the files and directories in the directory denoted by this abstract pathname.

booleangetIfNewer(String resourceName, File destination, long timestamp)
Downloads specified resource from the repository if it was modfified since specified date.
RepositorygetRepository()
booleanhasSessionListener(SessionListener listener)
booleanhasTransferListener(TransferListener listener)
booleanisInteractive()
voidopenConnection()
voidput(File source, String destination)
Copy a file from local system to remote
voidputDirectory(File sourceDirectory, String destinationDirectory)
Copy a directory from local system to remote
voidremoveSessionListener(SessionListener listener)
voidremoveTransferListener(TransferListener listener)
booleanresourceExists(String resourceName)
Check if a remote resource exists
voidsetInteractive(boolean interactive)
booleansupportsDirectoryCopy()

Field Detail

ROLE

public String ROLE

Method Detail

addSessionListener

public void addSessionListener(SessionListener listener)

addTransferListener

public void addTransferListener(TransferListener listener)

connect

public void connect(Repository source)

connect

public void connect(Repository source, ProxyInfo proxyInfo)

connect

public void connect(Repository source, AuthenticationInfo authenticationInfo)

connect

public void connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo)

disconnect

public void disconnect()

get

public void get(String resourceName, File destination)
Downloads specified resource from the repository to given file.

Parameters: resourceName destination

Throws: TransferFailedException ResourceDoesNotExistException AuthorizationException

getFileList

public List getFileList(String destinationDirectory)

Returns a List of strings naming the files and directories in the directory denoted by this abstract pathname.

If this abstract pathname does not denote a directory, or does not exist, then this method throws ResourceDoesNotExistException. Otherwise a List of strings is returned, one for each file or directory in the directory. Names denoting the directory itself and the directory's parent directory are not included in the result. Each string is a file name rather than a complete path.

There is no guarantee that the name strings in the resulting list will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.

Parameters: destinationDirectory directory to list contents of

Returns: A List of strings naming the files and directories in the directory denoted by this abstract pathname. The List will be empty if the directory is empty.

Throws: TransferFailedException if there's an error trying to access the remote side ResourceDoesNotExistException if destinationDirectory does not exist or is not a directory AuthorizationException if not authorized to list the contents of the directory

getIfNewer

public boolean getIfNewer(String resourceName, File destination, long timestamp)
Downloads specified resource from the repository if it was modfified since specified date. The date is measured in milliseconds, between the current time and midnight, January 1, 1970 UTC and aliged to GMT timezone.

Parameters: resourceName destination timestamp

Returns: true if newer resource has been downloaded, false if resource in the repository is older or has the same age.

Throws: TransferFailedException ResourceDoesNotExistException AuthorizationException

UNKNOWN: michal: I have to learn more about timezones! Specifically how to convert time for UTC to time for GMT and if such conversioin is needed.

getRepository

public Repository getRepository()

hasSessionListener

public boolean hasSessionListener(SessionListener listener)

hasTransferListener

public boolean hasTransferListener(TransferListener listener)

isInteractive

public boolean isInteractive()

openConnection

public void openConnection()

put

public void put(File source, String destination)
Copy a file from local system to remote

Parameters: source the local file destination the remote destination

Throws: TransferFailedException ResourceDoesNotExistException AuthorizationException

putDirectory

public void putDirectory(File sourceDirectory, String destinationDirectory)
Copy a directory from local system to remote

Parameters: sourceDirectory the local directory destinationDirectory the remote destination

Throws: TransferFailedException ResourceDoesNotExistException AuthorizationException

removeSessionListener

public void removeSessionListener(SessionListener listener)

removeTransferListener

public void removeTransferListener(TransferListener listener)

resourceExists

public boolean resourceExists(String resourceName)
Check if a remote resource exists

Parameters: resourceName

Returns: whether the resource exists or not

Throws: TransferFailedException if there's an error trying to access the remote side AuthorizationException if not authorized to verify the existence of the resource

setInteractive

public void setInteractive(boolean interactive)

supportsDirectoryCopy

public boolean supportsDirectoryCopy()

Returns: whether if this wagon supports directory operations