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
Base class for wagon which provide stream based API.
- Author:
- Michal Maczka
-
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkInputStream
(InputStream is, Resource resource) protected void
checkOutputStream
(Resource resource, OutputStream os) abstract void
abstract void
fillInputData
(InputData inputData) abstract void
fillOutputData
(OutputData outputData) void
Downloads specified resource from the repository to given file.boolean
getIfNewer
(String resourceName, File destination, long timestamp) Downloads specified resource from the repository if it was modified since specified date.boolean
getIfNewerToStream
(String resourceName, OutputStream stream, long timestamp) Downloads specified resource from the repository if it was modified since specified date.protected InputStream
getInputStream
(Resource resource) protected OutputStream
getOutputStream
(Resource resource) void
getToStream
(String resourceName, OutputStream stream) Downloads specified resource from the repository to given output stream.void
Copy a file from local system to remotevoid
putFromStream
(InputStream stream, String destination) void
putFromStream
(InputStream stream, String destination, long contentLength, long lastModified) Copy from a local input stream to remote.protected void
putFromStream
(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
-
Constructor Details
-
StreamWagon
public StreamWagon()
-
-
Method Details
-
fillInputData
public abstract void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException -
fillOutputData
- Throws:
TransferFailedException
-
closeConnection
- Specified by:
closeConnection
in classAbstractWagon
- Throws:
ConnectionException
-
get
public void get(String resourceName, File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException Description copied from interface:Wagon
Downloads specified resource from the repository to given file.- Specified by:
get
in interfaceWagon
- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
checkInputStream
- Throws:
TransferFailedException
-
getIfNewer
public boolean getIfNewer(String resourceName, File destination, long timestamp) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException Description copied from interface:Wagon
Downloads 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:
getIfNewer
in interfaceWagon
- Returns:
true
if newer resource has been downloaded,false
if resource in the repository is older or has the same age.- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
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:Wagon
Copy a file from local system to remote- Specified by:
put
in interfaceWagon
- Parameters:
source
- the local fileresourceName
- the remote destination- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
checkOutputStream
- Throws:
TransferFailedException
-
getOutputStream
- Throws:
TransferFailedException
-
getIfNewerToStream
public boolean getIfNewerToStream(String resourceName, OutputStream stream, long timestamp) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException Description copied from interface:StreamingWagon
Downloads 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:
getIfNewerToStream
in interfaceStreamingWagon
- Returns:
true
if newer resource has been downloaded,false
if resource in the repository is older or has the same age.- Throws:
ResourceDoesNotExistException
TransferFailedException
AuthorizationException
-
getToStream
public void getToStream(String resourceName, OutputStream stream) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException Description copied from interface:StreamingWagon
Downloads specified resource from the repository to given output stream.- Specified by:
getToStream
in interfaceStreamingWagon
- Throws:
ResourceDoesNotExistException
TransferFailedException
AuthorizationException
-
putFromStream
public void putFromStream(InputStream stream, String destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException - Specified by:
putFromStream
in interfaceStreamingWagon
- Parameters:
stream
- the local streamdestination
- the remote destination- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
putFromStream
public void putFromStream(InputStream stream, String destination, long contentLength, long lastModified) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException Description copied from interface:StreamingWagon
Copy from a local input stream to remote.- Specified by:
putFromStream
in interfaceStreamingWagon
- Parameters:
stream
- the local streamdestination
- the remote destination- Throws:
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
-
putFromStream
protected void putFromStream(InputStream stream, Resource resource) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException
-