public abstract class StreamWagon extends AbstractWagon implements StreamingWagon
authenticationInfo, DEFAULT_BUFFER_SIZE, interactive, proxyInfo, repository, sessionEventSupport, transferEventSupport
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT, ROLE
Constructor and Description |
---|
StreamWagon() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkInputStream(InputStream is,
Resource resource) |
protected void |
checkOutputStream(Resource resource,
OutputStream os) |
abstract void |
closeConnection() |
abstract void |
fillInputData(InputData inputData) |
abstract void |
fillOutputData(OutputData outputData) |
void |
get(String resourceName,
File destination)
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 |
put(File source,
String resourceName)
Copy a file from local system to remote
|
protected void |
putFromStream(InputStream stream,
Resource resource) |
void |
putFromStream(InputStream stream,
String destination) |
void |
putFromStream(InputStream stream,
String destination,
long contentLength,
long lastModified)
Copy from a local input stream to remote.
|
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
public StreamWagon()
public abstract void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
public abstract void fillOutputData(OutputData outputData) throws TransferFailedException
TransferFailedException
public abstract void closeConnection() throws ConnectionException
closeConnection
in class AbstractWagon
ConnectionException
public void get(String resourceName, File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
get
in interface Wagon
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected void checkInputStream(InputStream is, Resource resource) throws TransferFailedException
TransferFailedException
public boolean getIfNewer(String resourceName, File destination, long timestamp) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
getIfNewer
in interface Wagon
true
if newer resource has been downloaded, false
if resource
in the repository is older or has the same age.TransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected InputStream getInputStream(Resource resource) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
public void put(File source, String resourceName) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
put
in interface Wagon
source
- the local fileresourceName
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected void checkOutputStream(Resource resource, OutputStream os) throws TransferFailedException
TransferFailedException
protected OutputStream getOutputStream(Resource resource) throws TransferFailedException
TransferFailedException
public boolean getIfNewerToStream(String resourceName, OutputStream stream, long timestamp) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException
StreamingWagon
getIfNewerToStream
in interface StreamingWagon
true
if newer resource has been downloaded, false
if resource in the
repository is older or has the same age.ResourceDoesNotExistException
TransferFailedException
AuthorizationException
public void getToStream(String resourceName, OutputStream stream) throws ResourceDoesNotExistException, TransferFailedException, AuthorizationException
StreamingWagon
getToStream
in interface StreamingWagon
ResourceDoesNotExistException
TransferFailedException
AuthorizationException
public void putFromStream(InputStream stream, String destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
putFromStream
in interface StreamingWagon
stream
- the local streamdestination
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
public void putFromStream(InputStream stream, String destination, long contentLength, long lastModified) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
StreamingWagon
putFromStream
in interface StreamingWagon
stream
- the local streamdestination
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
protected void putFromStream(InputStream stream, Resource resource) throws TransferFailedException, AuthorizationException, ResourceDoesNotExistException
Copyright © 2003–2017 The Apache Software Foundation. All rights reserved.