public abstract class AbstractJschWagon extends StreamWagon implements SshWagon, CommandExecutor
| Modifier and Type | Field and Description |
|---|---|
protected static String |
EXEC_CHANNEL |
protected com.jcraft.jsch.Session |
session |
protected ScpHelper |
sshTool |
authenticationInfo, BUFFER_SEGMENT_SIZE, DEFAULT_BUFFER_SIZE, interactive, MAXIMUM_BUFFER_SIZE, MINIMUM_AMOUNT_OF_TRANSFER_CHUNKS, proxyInfo, repository, sessionEventSupport, transferEventSupportROLEDEFAULT_CONNECTION_TIMEOUT, DEFAULT_READ_TIMEOUT| Constructor and Description |
|---|
AbstractJschWagon() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeConnection() |
void |
executeCommand(String command) |
Streams |
executeCommand(String command,
boolean ignoreFailures) |
Streams |
executeCommand(String command,
boolean ignoreStdErr,
boolean ignoreNoneZeroExitCode) |
List<String> |
getFileList(String destinationDirectory)
Returns a
List of strings naming the files and directories in the directory denoted by
this abstract pathname. |
InteractiveUserInfo |
getInteractiveUserInfo() |
KnownHostsProvider |
getKnownHostsProvider() |
String |
getPreferredAuthentications() |
String |
getStrictHostKeyChecking() |
protected void |
handleGetException(Resource resource,
Exception e) |
void |
openConnectionInternal() |
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 |
setInteractiveUserInfo(InteractiveUserInfo interactiveUserInfo) |
void |
setKnownHostsProvider(KnownHostsProvider knownHostsProvider) |
void |
setPreferredAuthentications(String preferredAuthentications) |
void |
setStrictHostKeyChecking(String strictHostKeyChecking) |
void |
setUIKeyboardInteractive(com.jcraft.jsch.UIKeyboardInteractive uIKeyboardInteractive) |
boolean |
supportsDirectoryCopy()
Flag indicating if this wagon supports directory copy operations.
|
protected void |
transfer(Resource resource,
InputStream input,
OutputStream output,
int requestType,
long maxSize)
Write from
InputStream to OutputStream. |
checkInputStream, checkOutputStream, fillInputData, fillOutputData, get, getIfNewer, getIfNewerToStream, getInputStream, getOutputStream, getToStream, put, putFromStream, putFromStream, putFromStreamaddSessionListener, 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, 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, transferclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddSessionListener, addTransferListener, connect, connect, connect, connect, connect, connect, disconnect, get, getIfNewer, getReadTimeout, getRepository, getTimeout, hasSessionListener, hasTransferListener, isInteractive, openConnection, put, removeSessionListener, removeTransferListener, setInteractive, setReadTimeout, setTimeoutprotected com.jcraft.jsch.Session session
protected static final String EXEC_CHANNEL
public AbstractJschWagon()
public void openConnectionInternal() throws AuthenticationException
openConnectionInternal in class AbstractWagonAuthenticationExceptionpublic void closeConnection()
closeConnection in class StreamWagonpublic Streams executeCommand(String command, boolean ignoreStdErr, boolean ignoreNoneZeroExitCode) throws CommandExecutionException
CommandExecutionExceptionprotected void handleGetException(Resource resource, Exception e) throws TransferFailedException
TransferFailedExceptionpublic List<String> getFileList(String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
WagonList 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 WagongetFileList in class AbstractWagondestinationDirectory - 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
WagonputDirectory in interface WagonputDirectory in class AbstractWagonsourceDirectory - the local directorydestinationDirectory - the remote destinationTransferFailedExceptionResourceDoesNotExistExceptionAuthorizationExceptionpublic boolean resourceExists(String resourceName) throws TransferFailedException, AuthorizationException
WagonresourceExists in interface WagonresourceExists in class AbstractWagonTransferFailedException - if there's an error trying to access the remote sideAuthorizationException - if not authorized to verify the existence of the resourcepublic boolean supportsDirectoryCopy()
WagonsupportsDirectoryCopy in interface WagonsupportsDirectoryCopy in class AbstractWagonpublic void executeCommand(String command) throws CommandExecutionException
executeCommand in interface CommandExecutorCommandExecutionExceptionpublic Streams executeCommand(String command, boolean ignoreFailures) throws CommandExecutionException
executeCommand in interface CommandExecutorCommandExecutionExceptionpublic InteractiveUserInfo getInteractiveUserInfo()
public KnownHostsProvider getKnownHostsProvider()
public void setInteractiveUserInfo(InteractiveUserInfo interactiveUserInfo)
public void setKnownHostsProvider(KnownHostsProvider knownHostsProvider)
setKnownHostsProvider in interface SshWagonpublic void setUIKeyboardInteractive(com.jcraft.jsch.UIKeyboardInteractive uIKeyboardInteractive)
public String getPreferredAuthentications()
public void setPreferredAuthentications(String preferredAuthentications)
public String getStrictHostKeyChecking()
public void setStrictHostKeyChecking(String strictHostKeyChecking)
protected void transfer(Resource resource, InputStream input, OutputStream output, int requestType, long maxSize) throws IOException
InputStream to OutputStream.
Equivalent to AbstractWagon.transfer(Resource, InputStream, OutputStream, int, long) with a maxSize equals to
Integer.MAX_VALUEtransfer in class AbstractWagonresource - resource to transferinput - input streamoutput - output streamrequestType - one of TransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUTmaxSize - size of the bufferIOExceptionCopyright © 2003–2022 The Apache Software Foundation. All rights reserved.