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
public abstract class StreamWagon extends AbstractWagon implements StreamingWagon
Base class for wagon which provide stream based API.- Author:
- Michal Maczka
-
-
Field Summary
-
Fields inherited from class org.apache.maven.wagon.AbstractWagon
authenticationInfo, DEFAULT_BUFFER_SIZE, interactive, 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 void
checkInputStream(java.io.InputStream is, Resource resource)
protected void
checkOutputStream(Resource resource, java.io.OutputStream os)
abstract void
closeConnection()
abstract void
fillInputData(InputData inputData)
abstract void
fillOutputData(OutputData outputData)
void
get(java.lang.String resourceName, java.io.File destination)
Downloads specified resource from the repository to given file.boolean
getIfNewer(java.lang.String resourceName, java.io.File destination, long timestamp)
Downloads specified resource from the repository if it was modified since specified date.boolean
getIfNewerToStream(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.InputStream
getInputStream(Resource resource)
protected java.io.OutputStream
getOutputStream(Resource resource)
void
getToStream(java.lang.String resourceName, java.io.OutputStream stream)
Downloads specified resource from the repository to given output stream.void
put(java.io.File source, java.lang.String resourceName)
Copy a file from local system to remotevoid
putFromStream(java.io.InputStream stream, java.lang.String destination)
void
putFromStream(java.io.InputStream stream, java.lang.String destination, long contentLength, long lastModified)
Copy from a local input stream to remote.protected void
putFromStream(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, 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:
closeConnection
in classAbstractWagon
- Throws:
ConnectionException
-
get
public void get(java.lang.String resourceName, java.io.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
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, 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 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, 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
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, 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(java.lang.String resourceName, java.io.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(java.io.InputStream stream, java.lang.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(java.io.InputStream stream, java.lang.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(java.io.InputStream stream, Resource resource) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException
-
-