org.apache.maven.wagon.providers.file

Class FileWagon

Implemented Interfaces:
Wagon

public class FileWagon
extends StreamWagon

Wagon Provider for Local File System
Version:
$Id: FileWagon.java 485713 2006-12-11 15:30:14Z joakime $
Author:
Michal Maczka

Field Summary

Fields inherited from class org.apache.maven.wagon.AbstractWagon

DEFAULT_BUFFER_SIZE, authenticationInfo, interactive, proxyInfo, repository, sessionEventSupport, transferEventSupport

Fields inherited from interface org.apache.maven.wagon.Wagon

ROLE

Method Summary

void
closeConnection()
void
fillInputData(InputData inputData)
void
fillOutputData(OutputData outputData)
List
getFileList(String destinationDirectory)
Returns a List of strings naming the files and directories in the directory denoted by this abstract pathname.
void
openConnection()
void
putDirectory(File sourceDirectory, String destinationDirectory)
Copy a directory from local system to remote
boolean
resourceExists(String resourceName)
Check if a remote resource exists
boolean
supportsDirectoryCopy()

Methods inherited from class org.apache.maven.wagon.StreamWagon

closeConnection, fillInputData, fillOutputData, get, getIfNewer, openConnection, put

Methods inherited from class org.apache.maven.wagon.AbstractWagon

addSessionListener, addTransferListener, closeConnection, connect, connect, connect, connect, createParentDirectories, createZip, disconnect, fireGetCompleted, fireGetInitiated, fireGetStarted, firePutCompleted, firePutInitiated, firePutStarted, fireSessionConnectionRefused, fireSessionDebug, fireSessionDisconnected, fireSessionDisconnecting, fireSessionError, fireSessionLoggedIn, fireSessionLoggedOff, fireSessionOpened, fireSessionOpening, fireTransferDebug, fireTransferError, fireTransferProgress, getAuthenticationInfo, getFileList, getPath, getProxyInfo, getRepository, getSessionEventSupport, getTransfer, getTransfer, getTransferEventSupport, hasSessionListener, hasTransferListener, isInteractive, postProcessListeners, putDirectory, putTransfer, removeSessionListener, removeTransferListener, resourceExists, setInteractive, setSessionEventSupport, setTransferEventSupport, supportsDirectoryCopy, transfer, transfer, transfer

Method Details

closeConnection

public void closeConnection()
Overrides:
closeConnection in interface StreamWagon

fillInputData

public void fillInputData(InputData inputData)
            throws TransferFailedException,
                   ResourceDoesNotExistException
Overrides:
fillInputData in interface StreamWagon

fillOutputData

public void fillOutputData(OutputData outputData)
            throws TransferFailedException
Overrides:
fillOutputData in interface StreamWagon

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.

Specified by:
getFileList in interface Wagon
Overrides:
getFileList in interface AbstractWagon
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

openConnection

public void openConnection()
            throws ConnectionException
Specified by:
openConnection in interface Wagon
Overrides:
openConnection in interface StreamWagon

putDirectory

public void putDirectory(File sourceDirectory,
                         String destinationDirectory)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Copy a directory from local system to remote
Specified by:
putDirectory in interface Wagon
Overrides:
putDirectory in interface AbstractWagon
Parameters:
sourceDirectory - the local directory
destinationDirectory - the remote destination

resourceExists

public boolean resourceExists(String resourceName)
            throws TransferFailedException,
                   AuthorizationException
Check if a remote resource exists
Specified by:
resourceExists in interface Wagon
Overrides:
resourceExists in interface AbstractWagon
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

supportsDirectoryCopy

public boolean supportsDirectoryCopy()
Specified by:
supportsDirectoryCopy in interface Wagon
Overrides:
supportsDirectoryCopy in interface AbstractWagon
Returns:
whether if this wagon supports directory operations