|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.wagon.AbstractWagon
public abstract class AbstractWagon
Implementation of common facilties for Wagon providers.
Field Summary | |
---|---|
protected AuthenticationInfo |
authenticationInfo
|
protected static int |
DEFAULT_BUFFER_SIZE
|
protected boolean |
interactive
|
protected ProxyInfo |
proxyInfo
|
protected Repository |
repository
|
protected SessionEventSupport |
sessionEventSupport
|
protected TransferEventSupport |
transferEventSupport
|
Fields inherited from interface org.apache.maven.wagon.Wagon |
---|
ROLE |
Constructor Summary | |
---|---|
AbstractWagon()
|
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()
|
java.util.List |
getFileList(java.lang.String destinationDirectory)
Returns a List of strings naming the files and directories in the directory denoted by
this abstract pathname. |
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)
Copy a directory from local system to remote |
protected void |
putTransfer(Resource resource,
java.io.File source,
java.io.OutputStream output,
boolean closeOutput)
|
void |
removeSessionListener(SessionListener listener)
|
void |
removeTransferListener(TransferListener listener)
|
boolean |
resourceExists(java.lang.String resourceName)
Check if a remote resource exists |
void |
setInteractive(boolean interactive)
|
void |
setSessionEventSupport(SessionEventSupport sessionEventSupport)
|
void |
setTransferEventSupport(TransferEventSupport transferEventSupport)
|
boolean |
supportsDirectoryCopy()
|
protected void |
transfer(Resource resource,
java.io.File source,
java.io.OutputStream output,
boolean closeOutput)
Write from File to OutputStream |
protected void |
transfer(Resource resource,
java.io.InputStream input,
java.io.OutputStream output,
int requestType)
Write from InputStream to OutputStream . |
protected void |
transfer(Resource resource,
java.io.InputStream input,
java.io.OutputStream output,
int requestType,
int maxSize)
Write from InputStream to OutputStream . |
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 |
Methods inherited from interface org.apache.maven.wagon.Wagon |
---|
get, getIfNewer, openConnection, put |
Field Detail |
---|
protected static final int DEFAULT_BUFFER_SIZE
protected Repository repository
protected SessionEventSupport sessionEventSupport
protected TransferEventSupport transferEventSupport
protected ProxyInfo proxyInfo
protected AuthenticationInfo authenticationInfo
protected boolean interactive
Constructor Detail |
---|
public AbstractWagon()
Method Detail |
---|
public Repository getRepository()
getRepository
in interface Wagon
public ProxyInfo getProxyInfo()
public AuthenticationInfo getAuthenticationInfo()
public void connect(Repository repository) throws ConnectionException, AuthenticationException
connect
in interface Wagon
ConnectionException
AuthenticationException
public void connect(Repository repository, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException
connect
in interface Wagon
ConnectionException
AuthenticationException
public void connect(Repository repository, AuthenticationInfo authenticationInfo) throws ConnectionException, AuthenticationException
connect
in interface Wagon
ConnectionException
AuthenticationException
public void connect(Repository repository, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException
connect
in interface Wagon
ConnectionException
AuthenticationException
public void disconnect() throws ConnectionException
disconnect
in interface Wagon
ConnectionException
protected abstract void closeConnection() throws ConnectionException
ConnectionException
protected void createParentDirectories(java.io.File destination) throws TransferFailedException
TransferFailedException
protected void getTransfer(Resource resource, java.io.File destination, java.io.InputStream input) throws TransferFailedException
TransferFailedException
protected void getTransfer(Resource resource, java.io.File destination, java.io.InputStream input, boolean closeInput, int maxSize) throws TransferFailedException
TransferFailedException
protected void putTransfer(Resource resource, java.io.File source, java.io.OutputStream output, boolean closeOutput) throws TransferFailedException
TransferFailedException
protected void transfer(Resource resource, java.io.File source, java.io.OutputStream output, boolean closeOutput) throws TransferFailedException
File
to OutputStream
resource
- resource to transfersource
- file to read fromoutput
- output streamcloseOutput
- whether the output stream should be closed or not
TransferFailedException
protected void transfer(Resource resource, java.io.InputStream input, java.io.OutputStream output, int requestType) throws java.io.IOException
InputStream
to OutputStream
.
Equivalent to transfer(Resource, InputStream, OutputStream, int, int)
with a maxSize equal to Integer.MAX_VALUE
resource
- resource to transferinput
- input streamoutput
- output streamrequestType
- one of TransferEvent.REQUEST_GET
or TransferEvent.REQUEST_PUT
java.io.IOException
protected void transfer(Resource resource, java.io.InputStream input, java.io.OutputStream output, int requestType, int maxSize) throws java.io.IOException
InputStream
to OutputStream
.
Equivalent to transfer(Resource, InputStream, OutputStream, int, int)
with a maxSize equal to Integer.MAX_VALUE
resource
- resource to transferinput
- input streamoutput
- output streamrequestType
- one of TransferEvent.REQUEST_GET
or TransferEvent.REQUEST_PUT
maxSize
- size of the buffer
java.io.IOException
protected void fireTransferProgress(TransferEvent transferEvent, byte[] buffer, int n)
protected void fireGetCompleted(Resource resource, java.io.File localFile)
protected void fireGetStarted(Resource resource, java.io.File localFile)
protected void fireGetInitiated(Resource resource, java.io.File localFile)
protected void firePutInitiated(Resource resource, java.io.File localFile)
protected void firePutCompleted(Resource resource, java.io.File localFile)
protected void firePutStarted(Resource resource, java.io.File localFile)
protected void fireSessionDisconnected()
protected void fireSessionDisconnecting()
protected void fireSessionLoggedIn()
protected void fireSessionLoggedOff()
protected void fireSessionOpened()
protected void fireSessionOpening()
protected void fireSessionConnectionRefused()
protected void fireSessionError(java.lang.Exception exception)
protected void fireTransferDebug(java.lang.String message)
protected void fireSessionDebug(java.lang.String message)
public boolean hasTransferListener(TransferListener listener)
hasTransferListener
in interface Wagon
public void addTransferListener(TransferListener listener)
addTransferListener
in interface Wagon
public void removeTransferListener(TransferListener listener)
removeTransferListener
in interface Wagon
public void addSessionListener(SessionListener listener)
addSessionListener
in interface Wagon
public boolean hasSessionListener(SessionListener listener)
hasSessionListener
in interface Wagon
public void removeSessionListener(SessionListener listener)
removeSessionListener
in interface Wagon
protected void fireTransferError(Resource resource, java.lang.Exception e, int requestType)
public SessionEventSupport getSessionEventSupport()
public void setSessionEventSupport(SessionEventSupport sessionEventSupport)
public TransferEventSupport getTransferEventSupport()
public void setTransferEventSupport(TransferEventSupport transferEventSupport)
protected void postProcessListeners(Resource resource, java.io.File source, int requestType) throws TransferFailedException
TransferFailedException
public void putDirectory(java.io.File sourceDirectory, java.lang.String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
putDirectory
in interface Wagon
sourceDirectory
- the local directorydestinationDirectory
- the remote destination
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
public boolean supportsDirectoryCopy()
supportsDirectoryCopy
in interface Wagon
public void createZip(java.util.List files, java.io.File zipName, java.io.File basedir) throws java.io.IOException
java.io.IOException
private void writeZipEntry(java.util.zip.ZipOutputStream jar, java.io.File source, java.lang.String entryName) throws java.io.IOException
java.io.IOException
protected static java.lang.String getPath(java.lang.String basedir, java.lang.String dir)
public boolean isInteractive()
isInteractive
in interface Wagon
public void setInteractive(boolean interactive)
setInteractive
in interface Wagon
public java.util.List getFileList(java.lang.String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
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.
getFileList
in interface Wagon
destinationDirectory
- directory to list contents of
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.
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 directorypublic boolean resourceExists(java.lang.String resourceName) throws TransferFailedException, AuthorizationException
Wagon
resourceExists
in interface Wagon
TransferFailedException
- if there's an error trying to access the remote side
AuthorizationException
- if not authorized to verify the existence of the resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |