org.apache.maven.wagon
Class AbstractWagon
java.lang.Object
org.apache.maven.wagon.AbstractWagon
- All Implemented Interfaces:
- Wagon
- Direct Known Subclasses:
- StreamWagon
- public abstract class AbstractWagon
- extends java.lang.Object
- implements Wagon
Implementation of common facilties for Wagon providers.
- Version:
- $Id: AbstractWagon.java 314922 2005-10-12 14:16:36Z brett $
- Author:
- Michal Maczka
Fields inherited from interface org.apache.maven.wagon.Wagon |
ROLE |
Method Summary |
void |
addSessionListener(SessionListener listener)
|
void |
addTransferListener(TransferListener listener)
|
protected abstract void |
closeConnection()
|
void |
connect(Repository repository)
|
void |
connect(Repository repository,
AuthenticationInfo authenticationInfo)
|
void |
connect(Repository repository,
AuthenticationInfo authenticationInfo,
ProxyInfo proxyInfo)
|
void |
connect(Repository repository,
ProxyInfo proxyInfo)
|
protected void |
createParentDirectories(java.io.File destination)
|
void |
createZip(java.util.List files,
java.io.File zipName,
java.io.File basedir)
|
void |
disconnect()
|
protected void |
fireGetCompleted(Resource resource,
java.io.File localFile)
|
protected void |
fireGetInitiated(Resource resource,
java.io.File localFile)
|
protected void |
fireGetStarted(Resource resource,
java.io.File localFile)
|
protected void |
firePutCompleted(Resource resource,
java.io.File localFile)
|
protected void |
firePutInitiated(Resource resource,
java.io.File localFile)
|
protected void |
firePutStarted(Resource resource,
java.io.File localFile)
|
protected void |
fireSessionConnectionRefused()
|
protected void |
fireSessionDebug(java.lang.String message)
|
protected void |
fireSessionDisconnected()
|
protected void |
fireSessionDisconnecting()
|
protected void |
fireSessionError(java.lang.Exception exception)
|
protected void |
fireSessionLoggedIn()
|
protected void |
fireSessionLoggedOff()
|
protected void |
fireSessionOpened()
|
protected void |
fireSessionOpening()
|
protected void |
fireTransferDebug(java.lang.String message)
|
protected void |
fireTransferError(Resource resource,
java.lang.Exception e,
int requestType)
|
protected void |
fireTransferProgress(TransferEvent transferEvent,
byte[] buffer,
int n)
|
AuthenticationInfo |
getAuthenticationInfo()
|
protected static java.lang.String |
getPath(java.lang.String basedir,
java.lang.String dir)
|
ProxyInfo |
getProxyInfo()
|
Repository |
getRepository()
|
SessionEventSupport |
getSessionEventSupport()
|
protected void |
getTransfer(Resource resource,
java.io.File destination,
java.io.InputStream input)
|
protected void |
getTransfer(Resource resource,
java.io.File destination,
java.io.InputStream input,
boolean closeInput,
int maxSize)
|
TransferEventSupport |
getTransferEventSupport()
|
boolean |
hasSessionListener(SessionListener listener)
|
boolean |
hasTransferListener(TransferListener listener)
|
boolean |
isInteractive()
|
protected void |
postProcessListeners(Resource resource,
java.io.File source,
int requestType)
This method is used if you are not streaming the transfer, to make sure any listeners dependent on state
(eg checksum observers) succeed. |
void |
putDirectory(java.io.File sourceDirectory,
java.lang.String destinationDirectory)
|
protected void |
putTransfer(Resource resource,
java.io.File source,
java.io.OutputStream output,
boolean closeOutput)
|
void |
removeSessionListener(SessionListener listener)
|
void |
removeTransferListener(TransferListener listener)
|
void |
setInteractive(boolean interactive)
|
void |
setSessionEventSupport(SessionEventSupport sessionEventSupport)
|
void |
setTransferEventSupport(TransferEventSupport transferEventSupport)
|
boolean |
supportsDirectoryCopy()
|
protected void |
transfer(Resource resource,
java.io.InputStream input,
java.io.OutputStream output,
int requestType)
|
protected void |
transfer(Resource resource,
java.io.InputStream input,
java.io.OutputStream output,
int requestType,
int maxSize)
|
private void |
writeZipEntry(java.util.zip.ZipOutputStream jar,
java.io.File source,
java.lang.String entryName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_BUFFER_SIZE
protected static final int DEFAULT_BUFFER_SIZE
- See Also:
- Constant Field Values
repository
protected Repository repository
sessionEventSupport
protected SessionEventSupport sessionEventSupport
transferEventSupport
protected TransferEventSupport transferEventSupport
proxyInfo
protected ProxyInfo proxyInfo
authenticationInfo
protected AuthenticationInfo authenticationInfo
interactive
protected boolean interactive
AbstractWagon
public AbstractWagon()
getRepository
public Repository getRepository()
- Specified by:
getRepository
in interface Wagon
getProxyInfo
public ProxyInfo getProxyInfo()
getAuthenticationInfo
public AuthenticationInfo getAuthenticationInfo()
connect
public void connect(Repository repository)
throws ConnectionException,
AuthenticationException
- Specified by:
connect
in interface Wagon
- Throws:
ConnectionException
AuthenticationException
connect
public void connect(Repository repository,
ProxyInfo proxyInfo)
throws ConnectionException,
AuthenticationException
- Specified by:
connect
in interface Wagon
- Throws:
ConnectionException
AuthenticationException
connect
public void connect(Repository repository,
AuthenticationInfo authenticationInfo)
throws ConnectionException,
AuthenticationException
- Specified by:
connect
in interface Wagon
- Throws:
ConnectionException
AuthenticationException
connect
public void connect(Repository repository,
AuthenticationInfo authenticationInfo,
ProxyInfo proxyInfo)
throws ConnectionException,
AuthenticationException
- Specified by:
connect
in interface Wagon
- Throws:
ConnectionException
AuthenticationException
disconnect
public void disconnect()
throws ConnectionException
- Specified by:
disconnect
in interface Wagon
- Throws:
ConnectionException
closeConnection
protected abstract void closeConnection()
throws ConnectionException
- Throws:
ConnectionException
createParentDirectories
protected void createParentDirectories(java.io.File destination)
throws TransferFailedException
- Throws:
TransferFailedException
getTransfer
protected void getTransfer(Resource resource,
java.io.File destination,
java.io.InputStream input)
throws TransferFailedException
- Throws:
TransferFailedException
getTransfer
protected void getTransfer(Resource resource,
java.io.File destination,
java.io.InputStream input,
boolean closeInput,
int maxSize)
throws TransferFailedException
- Throws:
TransferFailedException
putTransfer
protected void putTransfer(Resource resource,
java.io.File source,
java.io.OutputStream output,
boolean closeOutput)
throws TransferFailedException
- Throws:
TransferFailedException
transfer
protected void transfer(Resource resource,
java.io.InputStream input,
java.io.OutputStream output,
int requestType)
throws java.io.IOException
- Throws:
java.io.IOException
transfer
protected void transfer(Resource resource,
java.io.InputStream input,
java.io.OutputStream output,
int requestType,
int maxSize)
throws java.io.IOException
- Throws:
java.io.IOException
fireTransferProgress
protected void fireTransferProgress(TransferEvent transferEvent,
byte[] buffer,
int n)
fireGetCompleted
protected void fireGetCompleted(Resource resource,
java.io.File localFile)
fireGetStarted
protected void fireGetStarted(Resource resource,
java.io.File localFile)
fireGetInitiated
protected void fireGetInitiated(Resource resource,
java.io.File localFile)
firePutInitiated
protected void firePutInitiated(Resource resource,
java.io.File localFile)
firePutCompleted
protected void firePutCompleted(Resource resource,
java.io.File localFile)
firePutStarted
protected void firePutStarted(Resource resource,
java.io.File localFile)
fireSessionDisconnected
protected void fireSessionDisconnected()
fireSessionDisconnecting
protected void fireSessionDisconnecting()
fireSessionLoggedIn
protected void fireSessionLoggedIn()
fireSessionLoggedOff
protected void fireSessionLoggedOff()
fireSessionOpened
protected void fireSessionOpened()
fireSessionOpening
protected void fireSessionOpening()
fireSessionConnectionRefused
protected void fireSessionConnectionRefused()
fireSessionError
protected void fireSessionError(java.lang.Exception exception)
fireTransferDebug
protected void fireTransferDebug(java.lang.String message)
fireSessionDebug
protected void fireSessionDebug(java.lang.String message)
hasTransferListener
public boolean hasTransferListener(TransferListener listener)
- Specified by:
hasTransferListener
in interface Wagon
addTransferListener
public void addTransferListener(TransferListener listener)
- Specified by:
addTransferListener
in interface Wagon
removeTransferListener
public void removeTransferListener(TransferListener listener)
- Specified by:
removeTransferListener
in interface Wagon
addSessionListener
public void addSessionListener(SessionListener listener)
- Specified by:
addSessionListener
in interface Wagon
hasSessionListener
public boolean hasSessionListener(SessionListener listener)
- Specified by:
hasSessionListener
in interface Wagon
removeSessionListener
public void removeSessionListener(SessionListener listener)
- Specified by:
removeSessionListener
in interface Wagon
fireTransferError
protected void fireTransferError(Resource resource,
java.lang.Exception e,
int requestType)
getSessionEventSupport
public SessionEventSupport getSessionEventSupport()
setSessionEventSupport
public void setSessionEventSupport(SessionEventSupport sessionEventSupport)
getTransferEventSupport
public TransferEventSupport getTransferEventSupport()
setTransferEventSupport
public void setTransferEventSupport(TransferEventSupport transferEventSupport)
postProcessListeners
protected void postProcessListeners(Resource resource,
java.io.File source,
int requestType)
throws TransferFailedException
- This method is used if you are not streaming the transfer, to make sure any listeners dependent on state
(eg checksum observers) succeed.
- Throws:
TransferFailedException
putDirectory
public void putDirectory(java.io.File sourceDirectory,
java.lang.String destinationDirectory)
throws TransferFailedException,
ResourceDoesNotExistException,
AuthorizationException
- Specified by:
putDirectory
in interface Wagon
- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
supportsDirectoryCopy
public boolean supportsDirectoryCopy()
- Specified by:
supportsDirectoryCopy
in interface Wagon
createZip
public void createZip(java.util.List files,
java.io.File zipName,
java.io.File basedir)
throws java.io.IOException
- Throws:
java.io.IOException
writeZipEntry
private void writeZipEntry(java.util.zip.ZipOutputStream jar,
java.io.File source,
java.lang.String entryName)
throws java.io.IOException
- Throws:
java.io.IOException
getPath
protected static java.lang.String getPath(java.lang.String basedir,
java.lang.String dir)
isInteractive
public boolean isInteractive()
- Specified by:
isInteractive
in interface Wagon
setInteractive
public void setInteractive(boolean interactive)
- Specified by:
setInteractive
in interface Wagon