org.apache.maven.wagon

Interface Wagon

Known Subinterfaces:
CommandExecutor, SshWagon
Known Implementing Classes:
AbstractGanymedWagon, AbstractJschWagon, AbstractSshWagon, AbstractWagon, FileWagon, FtpWagon, HttpWagon, LightweightHttpWagon, ScpExternalWagon, ScpWagon, ScpWagon, SftpWagon, StreamWagon, WebDavWagon

public interface Wagon

Field Summary

static String
ROLE

Method Summary

void
addSessionListener(SessionListener listener)
void
addTransferListener(TransferListener listener)
void
connect(Repository source)
void
connect(Repository source, AuthenticationInfo authenticationInfo)
void
connect(Repository source, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo)
void
connect(Repository source, ProxyInfo proxyInfo)
void
disconnect()
void
get(String resourceName, File destination)
Downloads specified resource from the repository to given file.
List
getFileList(String destinationDirectory)
Returns a List of strings naming the files and directories in the directory denoted by this abstract pathname.
boolean
getIfNewer(String resourceName, File destination, long timestamp)
Downloads specified resource from the repository if it was modfified since specified date.
Repository
getRepository()
boolean
hasSessionListener(SessionListener listener)
boolean
hasTransferListener(TransferListener listener)
boolean
isInteractive()
void
openConnection()
void
put(File source, String destination)
Copy a file from local system to remote
void
putDirectory(File sourceDirectory, String destinationDirectory)
Copy a directory from local system to remote
void
removeSessionListener(SessionListener listener)
void
removeTransferListener(TransferListener listener)
boolean
resourceExists(String resourceName)
Check if a remote resource exists
void
setInteractive(boolean interactive)
boolean
supportsDirectoryCopy()

Field Details

ROLE

public static final String ROLE

Method Details

addSessionListener

public void addSessionListener(SessionListener listener)

addTransferListener

public void addTransferListener(TransferListener listener)

connect

public void connect(Repository source)
            throws ConnectionException,
                   AuthenticationException

connect

public void connect(Repository source,
                    AuthenticationInfo authenticationInfo)
            throws ConnectionException,
                   AuthenticationException

connect

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

connect

public void connect(Repository source,
                    ProxyInfo proxyInfo)
            throws ConnectionException,
                   AuthenticationException

disconnect

public void disconnect()
            throws ConnectionException

get

public void get(String resourceName,
                File destination)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Downloads specified resource from the repository to given file.
Parameters:
resourceName -
destination -

getFileList

public List getFileList(String destinationDirectory)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
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)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
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.

getRepository

public Repository getRepository()

hasSessionListener

public boolean hasSessionListener(SessionListener listener)

hasTransferListener

public boolean hasTransferListener(TransferListener listener)

isInteractive

public boolean isInteractive()

openConnection

public void openConnection()
            throws ConnectionException,
                   AuthenticationException

put

public void put(File source,
                String destination)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Copy a file from local system to remote
Parameters:
source - the local file
destination - the remote destination

putDirectory

public void putDirectory(File sourceDirectory,
                         String destinationDirectory)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Copy a directory from local system to remote
Parameters:
sourceDirectory - the local directory
destinationDirectory - the remote destination

removeSessionListener

public void removeSessionListener(SessionListener listener)

removeTransferListener

public void removeTransferListener(TransferListener listener)

resourceExists

public boolean resourceExists(String resourceName)
            throws TransferFailedException,
                   AuthorizationException
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