Package org.apache.maven.wagon
Class StreamWagon
- java.lang.Object
-
- org.apache.maven.wagon.AbstractWagon
-
- org.apache.maven.wagon.StreamWagon
-
- All Implemented Interfaces:
StreamingWagon,Wagon
- Direct Known Subclasses:
AbstractHttpClientWagon,FileWagon
public abstract class StreamWagon extends AbstractWagon implements StreamingWagon
Base class for wagon which provide stream based API.
-
-
Field Summary
-
Fields inherited from class org.apache.maven.wagon.AbstractWagon
authenticationInfo, BUFFER_SEGMENT_SIZE, DEFAULT_BUFFER_SIZE, interactive, MAXIMUM_BUFFER_SIZE, MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS, proxyInfo, repository, sessionEventSupport, transferEventSupport
-
Fields inherited from interface org.apache.maven.wagon.Wagon
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, ROLE
-
-
Constructor Summary
Constructors Constructor Description StreamWagon()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckInputStream(java.io.InputStream is, Resource resource)protected voidcheckOutputStream(Resource resource, java.io.OutputStream os)abstract voidcloseConnection()abstract voidfillInputData(InputData inputData)abstract voidfillOutputData(OutputData outputData)voidget(java.lang.String resourceName, java.io.File destination)Downloads specified resource from the repository to given file.booleangetIfNewer(java.lang.String resourceName, java.io.File destination, long timestamp)Downloads specified resource from the repository if it was modified since specified date.booleangetIfNewerToStream(java.lang.String resourceName, java.io.OutputStream stream, long timestamp)Downloads specified resource from the repository if it was modified since specified date.protected java.io.InputStreamgetInputStream(Resource resource)protected java.io.OutputStreamgetOutputStream(Resource resource)voidgetToStream(java.lang.String resourceName, java.io.OutputStream stream)Downloads specified resource from the repository to given output stream.voidput(java.io.File source, java.lang.String resourceName)Copy a file from local system to remotevoidputFromStream(java.io.InputStream stream, java.lang.String destination)voidputFromStream(java.io.InputStream stream, java.lang.String destination, long contentLength, long lastModified)Copy from a local input stream to remote.protected voidputFromStream(java.io.InputStream stream, Resource resource)-
Methods inherited from class org.apache.maven.wagon.AbstractWagon
addSessionListener, addTransferListener, cleanupGetTransfer, cleanupPutTransfer, connect, connect, connect, connect, connect, connect, createParentDirectories, disconnect, finishGetTransfer, finishPutTransfer, fireGetCompleted, fireGetInitiated, fireGetStarted, firePutCompleted, firePutInitiated, firePutStarted, fireSessionConnectionRefused, fireSessionDebug, fireSessionDisconnected, fireSessionDisconnecting, fireSessionError, fireSessionLoggedIn, fireSessionLoggedOff, fireSessionOpened, fireSessionOpening, fireTransferDebug, fireTransferError, fireTransferProgress, getAuthenticationInfo, getBufferCapacityForTransfer, getFileList, getPath, getPermissionsOverride, getProxyInfo, getProxyInfo, getReadTimeout, getRepository, getSessionEventSupport, getTimeout, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransferEventSupport, hasSessionListener, hasTransferListener, isInteractive, openConnection, openConnectionInternal, postProcessListeners, putDirectory, putTransfer, putTransfer, removeSessionListener, removeTransferListener, resourceExists, setInteractive, setPermissionsOverride, setReadTimeout, setSessionEventSupport, setTimeout, setTransferEventSupport, supportsDirectoryCopy, transfer, transfer, transfer, transfer
-
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
addSessionListener, addTransferListener, connect, connect, connect, connect, connect, connect, disconnect, getFileList, getReadTimeout, getRepository, getTimeout, hasSessionListener, hasTransferListener, isInteractive, openConnection, putDirectory, removeSessionListener, removeTransferListener, resourceExists, setInteractive, setReadTimeout, setTimeout, supportsDirectoryCopy
-
-
-
-
Method Detail
-
fillInputData
public abstract void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
-
fillOutputData
public abstract void fillOutputData(OutputData outputData) throws TransferFailedException
- Throws:
TransferFailedException
-
closeConnection
public abstract void closeConnection() throws ConnectionException- Specified by:
closeConnectionin classAbstractWagon- Throws:
ConnectionException
-
get
public void get(java.lang.String resourceName, java.io.File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationExceptionDescription copied from interface:WagonDownloads specified resource from the repository to given file.- Specified by:
getin interfaceWagon- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
checkInputStream
protected void checkInputStream(java.io.InputStream is, Resource resource) throws TransferFailedException- Throws:
TransferFailedException
-
getIfNewer
public boolean getIfNewer(java.lang.String resourceName, java.io.File destination, long timestamp) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationExceptionDescription copied from interface:WagonDownloads specified resource from the repository if it was modified since specified date. The date is measured in milliseconds, between the current time and midnight, January 1, 1970 UTC and aligned to GMT timezone.- Specified by:
getIfNewerin interfaceWagon- Returns:
trueif newer resource has been downloaded,falseif resource in the repository is older or has the same age.- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
getInputStream
protected java.io.InputStream getInputStream(Resource resource) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
-
put
public void put(java.io.File source, java.lang.String resourceName) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationExceptionDescription copied from interface:WagonCopy a file from local system to remote- Specified by:
putin interfaceWagon- Parameters:
source- the local fileresourceName- the remote destination- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
checkOutputStream
protected void checkOutputStream(Resource resource, java.io.OutputStream os) throws TransferFailedException
- Throws:
TransferFailedException
-
getOutputStream
protected java.io.OutputStream getOutputStream(Resource resource) throws TransferFailedException
- Throws:
TransferFailedException
-
getIfNewerToStream
public boolean getIfNewerToStream(java.lang.String resourceName, java.io.OutputStream stream, long timestamp) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationExceptionDescription copied from interface:StreamingWagonDownloads specified resource from the repository if it was modified since specified date. The date is measured in milliseconds, between the current time and midnight, January 1, 1970 UTC and aligned to GMT timezone.- Specified by:
getIfNewerToStreamin interfaceStreamingWagon- Returns:
trueif newer resource has been downloaded,falseif resource in the repository is older or has the same age.- Throws:
ResourceDoesNotExistExceptionTransferFailedExceptionAuthorizationException
-
getToStream
public void getToStream(java.lang.String resourceName, java.io.OutputStream stream) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationExceptionDescription copied from interface:StreamingWagonDownloads specified resource from the repository to given output stream.- Specified by:
getToStreamin interfaceStreamingWagon- Throws:
ResourceDoesNotExistExceptionTransferFailedExceptionAuthorizationException
-
putFromStream
public void putFromStream(java.io.InputStream stream, java.lang.String destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException- Specified by:
putFromStreamin interfaceStreamingWagon- Parameters:
stream- the local streamdestination- the remote destination- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
putFromStream
public void putFromStream(java.io.InputStream stream, java.lang.String destination, long contentLength, long lastModified) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationExceptionDescription copied from interface:StreamingWagonCopy from a local input stream to remote.- Specified by:
putFromStreamin interfaceStreamingWagon- Parameters:
stream- the local streamdestination- the remote destination- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
putFromStream
protected void putFromStream(java.io.InputStream stream, Resource resource) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException
-
-