public class ScpExternalWagon extends AbstractWagon implements CommandExecutor
|
authenticationInfo, DEFAULT_BUFFER_SIZE, interactive, proxyInfo, repository, sessionEventSupport, transferEventSupport
ROLE
DEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT
Constructor and Description |
---|
ScpExternalWagon() |
Modifier and Type | Method and Description |
---|---|
void |
closeConnection() |
void |
executeCommand(String command) |
Streams |
executeCommand(String command,
boolean ignoreFailures) |
void |
get(String resourceName,
File destination)
Downloads specified resource from the repository to given file.
|
List<String> |
getFileList(String destinationDirectory)
Returns a
List of strings naming the files and directories in the directory denoted by
this abstract pathname. |
boolean |
getIfNewer(String resourceName,
File destination,
long timestamp)
Downloads specified resource from the repository
if it was modified since specified date.
|
String |
getScpArgs() |
String |
getScpExecutable() |
String |
getSshArgs() |
String |
getSshExecutable() |
protected boolean |
isPuTTY() |
protected void |
openConnectionInternal() |
void |
put(File source,
String destination)
Copy a file from local system to remote
|
void |
putDirectory(File sourceDirectory,
String destinationDirectory)
Copy a directory from local system to remote
|
boolean |
resourceExists(String resourceName)
Check if a remote resource exists
|
void |
setScpArgs(String scpArgs) |
void |
setScpExecutable(String scpExecutable) |
void |
setSshArgs(String sshArgs) |
void |
setSshExecutable(String sshExecutable) |
boolean |
supportsDirectoryCopy()
Flag indicating if this wagon supports directory copy operations.
|
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, getPath, getPermissionsOverride, getProxyInfo, getProxyInfo, getReadTimeout, getRepository, getSessionEventSupport, getTimeout, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransferEventSupport, hasSessionListener, hasTransferListener, isInteractive, openConnection, postProcessListeners, putTransfer, putTransfer, removeSessionListener, removeTransferListener, setInteractive, setPermissionsOverride, setReadTimeout, setSessionEventSupport, setTimeout, setTransferEventSupport, transfer, transfer, transfer, transfer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSessionListener, addTransferListener, connect, connect, connect, connect, connect, connect, disconnect, getReadTimeout, getRepository, getTimeout, hasSessionListener, hasTransferListener, isInteractive, openConnection, removeSessionListener, removeTransferListener, setInteractive, setReadTimeout, setTimeout
public ScpExternalWagon()
protected void openConnectionInternal() throws AuthenticationException
openConnectionInternal
in class AbstractWagon
AuthenticationException
public void closeConnection()
closeConnection
in class AbstractWagon
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
public void executeCommand(String command) throws CommandExecutionException
executeCommand
in interface CommandExecutor
CommandExecutionException
public Streams executeCommand(String command, boolean ignoreFailures) throws CommandExecutionException
executeCommand
in interface CommandExecutor
CommandExecutionException
protected boolean isPuTTY()
public void put(File source, String destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
put
in interface Wagon
source
- the local filedestination
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
public void get(String resourceName, File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
get
in interface Wagon
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
public List<String> getFileList(String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
List
of strings naming the files and directories in the directory denoted by
this abstract pathname.
If this abstract pathname does not denote a directory, or does not exist, then this method throws
ResourceDoesNotExistException
.
Otherwise a List
of strings is returned, one for each file or directory in the directory.
Names denoting the directory itself and the directory's parent directory are not included in
the result. Each string is a file name rather than a complete path.
There is no guarantee that the name strings in the resulting list will appear in any specific
order; they are not, in particular, guaranteed to appear in alphabetical order.
getFileList
in interface Wagon
getFileList
in class AbstractWagon
destinationDirectory
- directory to list contents ofList
of strings naming the files and directories in the directory denoted by
this abstract pathname. The List
will be empty if the directory is empty.TransferFailedException
- if there's an error trying to access the remote sideResourceDoesNotExistException
- if destinationDirectory does not exist or is not a directoryAuthorizationException
- if not authorized to list the contents of the directorypublic void putDirectory(File sourceDirectory, String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
putDirectory
in interface Wagon
putDirectory
in class AbstractWagon
sourceDirectory
- the local directorydestinationDirectory
- the remote destinationTransferFailedException
ResourceDoesNotExistException
AuthorizationException
public boolean resourceExists(String resourceName) throws TransferFailedException, AuthorizationException
Wagon
resourceExists
in interface Wagon
resourceExists
in class AbstractWagon
TransferFailedException
- if there's an error trying to access the remote sideAuthorizationException
- if not authorized to verify the existence of the resourcepublic boolean supportsDirectoryCopy()
Wagon
supportsDirectoryCopy
in interface Wagon
supportsDirectoryCopy
in class AbstractWagon
public String getScpExecutable()
public void setScpExecutable(String scpExecutable)
public String getSshExecutable()
public void setSshExecutable(String sshExecutable)
public String getScpArgs()
public void setScpArgs(String scpArgs)
public String getSshArgs()
public void setSshArgs(String sshArgs)
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.