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
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, transferEventSupportFields inherited from interface org.apache.maven.wagon.Wagon
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckInputStream(InputStream is, Resource resource) protected voidcheckOutputStream(Resource resource, OutputStream os) abstract voidabstract voidfillInputData(InputData inputData) abstract voidfillOutputData(OutputData outputData) voidDownloads specified resource from the repository to given file.booleangetIfNewer(String resourceName, File destination, long timestamp) Downloads specified resource from the repository if it was modified since specified date.booleangetIfNewerToStream(String resourceName, OutputStream stream, long timestamp) Downloads specified resource from the repository if it was modified since specified date.protected InputStreamgetInputStream(Resource resource) protected OutputStreamgetOutputStream(Resource resource) voidgetToStream(String resourceName, OutputStream stream) Downloads specified resource from the repository to given output stream.voidCopy a file from local system to remotevoidputFromStream(InputStream stream, String destination) voidputFromStream(InputStream stream, String destination, long contentLength, long lastModified) Copy from a local input stream to remote.protected voidputFromStream(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, transferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Constructor Details
-
StreamWagon
public StreamWagon()
-
-
Method Details
-
fillInputData
public abstract void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException -
fillOutputData
- Throws:
TransferFailedException
-
closeConnection
- Specified by:
closeConnectionin classAbstractWagon- Throws:
ConnectionException
-
get
public void get(String resourceName, File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException Description copied from interface:WagonDownloads specified resource from the repository to given file.- Specified by:
getin interfaceWagon- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
checkInputStream
- Throws:
TransferFailedException
-
getIfNewer
public boolean getIfNewer(String resourceName, File destination, long timestamp) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException Description 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 InputStream getInputStream(Resource resource) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException -
put
public void put(File source, String resourceName) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException Description 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
- Throws:
TransferFailedException
-
getOutputStream
- Throws:
TransferFailedException
-
getIfNewerToStream
public boolean getIfNewerToStream(String resourceName, OutputStream stream, long timestamp) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException Description 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(String resourceName, OutputStream stream) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException Description copied from interface:StreamingWagonDownloads specified resource from the repository to given output stream.- Specified by:
getToStreamin interfaceStreamingWagon- Throws:
ResourceDoesNotExistExceptionTransferFailedExceptionAuthorizationException
-
putFromStream
public void putFromStream(InputStream stream, String destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - Specified by:
putFromStreamin interfaceStreamingWagon- Parameters:
stream- the local streamdestination- the remote destination- Throws:
TransferFailedExceptionResourceDoesNotExistExceptionAuthorizationException
-
putFromStream
public void putFromStream(InputStream stream, String destination, long contentLength, long lastModified) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException Description 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(InputStream stream, Resource resource) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException
-