org.apache.maven.wagon.providers.webdav

Class WebDavWagon

Implemented Interfaces:
Wagon

public class WebDavWagon
extends AbstractWagon

WebDavWagon

Allows using a webdav remote repository for downloads and deployments

TODO: webdav https server is not tested

Authors:
Henry Isidro
Joakim Erdfelt
Carlos Sanchez

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

Constructor Summary

WebDavWagon()

Method Summary

void
closeConnection()
Closes the connection
void
get(String resourceName, File destination)
boolean
get(String resourceName, File destination, long timestamp)
Get a file from remote server
List
getFileList(String destinationDirectory)
boolean
getIfNewer(String resourceName, File destination, long timestamp)
void
openConnection()
Opens a connection via web-dav resource
void
put(File source, String resourceName)
Puts a file into the remote repository
void
putDirectory(File sourceDirectory, String destinationDirectory)
Copy a directory from local system to remote webdav server
boolean
resourceExists(String resourceName)
boolean
supportsDirectoryCopy()
This wagon supports directory copying

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

Constructor Details

WebDavWagon

public WebDavWagon()

Method Details

closeConnection

public void closeConnection()
            throws ConnectionException
Closes the connection
Overrides:
closeConnection in interface AbstractWagon

get

public void get(String resourceName,
                File destination)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Specified by:
get in interface Wagon

get

public boolean get(String resourceName,
                   File destination,
                   long timestamp)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Get a file from remote server
Parameters:
resourceName -
destination -
timestamp - the timestamp to check against, only downloading if newer. If 0, always download
Returns:
true if newer version was downloaded, false otherwise.

getFileList

public List getFileList(String destinationDirectory)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Specified by:
getFileList in interface Wagon
Overrides:
getFileList in interface AbstractWagon

getIfNewer

public boolean getIfNewer(String resourceName,
                          File destination,
                          long timestamp)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Specified by:
getIfNewer in interface Wagon

openConnection

public void openConnection()
            throws AuthenticationException,
                   ConnectionException
Opens a connection via web-dav resource
Specified by:
openConnection in interface Wagon

put

public void put(File source,
                String resourceName)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Puts a file into the remote repository
Specified by:
put in interface Wagon
Parameters:
source - the file to transfer
resourceName - the name of the resource

putDirectory

public void putDirectory(File sourceDirectory,
                         String destinationDirectory)
            throws TransferFailedException,
                   ResourceDoesNotExistException,
                   AuthorizationException
Copy a directory from local system to remote webdav server
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
Specified by:
resourceExists in interface Wagon
Overrides:
resourceExists in interface AbstractWagon

supportsDirectoryCopy

public boolean supportsDirectoryCopy()
This wagon supports directory copying
Specified by:
supportsDirectoryCopy in interface Wagon
Overrides:
supportsDirectoryCopy in interface AbstractWagon
Returns:
true always