public class AdvancedSSHSettings
extends java.lang.Object
All settings must be set before connecting to the server.
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkDirReadableForChDir()
Check that a directory is readable prior to changing into it.
|
void |
disableAllAlgorithms()
Disables all algorithms.
|
void |
disableAllAlgorithms(int algorithmType)
Disables all algorithms of a particular type.
|
SSHAuthenticationType |
getAuthenticationType()
Get the type of authentication that is set up to be used.
|
SSHFTPAlgorithm[] |
getEnabledAlgorithms()
Returns an array containing all enabled algorithms (of all types).
|
SSHFTPAlgorithm[] |
getEnabledAlgorithms(int algorithmType)
Returns an array containing all enabled algorithms of a particular type.
|
int |
getMaxPacketSize()
Get the max packet size set
|
int |
getMaxQueuedReadRequests() |
byte[] |
getPrivateKeyBytes()
Returns a byte-array containing the client's private key if one has been set.
|
java.lang.String |
getPrivateKeyFile()
Get the path of the file from which the client's private key was read
(if
setPrivateKeyFile was previously called). |
java.lang.String |
getPrivateKeyFilePassphrase()
Get the passphrase for the private key file.
|
java.io.InputStream |
getPrivateKeyInputStream()
Returns an InputStream for the client's private key,
used for client authentication if SSHAuthenticationType.PUBLIC_KEY is
being used.
|
java.lang.String |
getRemoteEOL()
Get the remote EOL string that is
forced to be used irrespective of what is
detected from server information.
|
SSHAuthPrompt[] |
getSSHAuthPrompts()
Get the array of authentication prompts that are to be used for keyboard-interactive
authentication.
|
SSHFTPValidator |
getSSHServerValidator()
Returns a reference to the host validator, which validates
the server's public key.
|
java.lang.String |
getUmask()
Get the current umask used for creating files
|
boolean |
isCompressionDelayed()
Is compression set to be delayed until after authentication? The default is
to allow the server to decide, i.e.
|
boolean |
isDisableChModAfterCreateDir()
Is the permission change made after creating a directory (which
is done to ensure the permissions are correct) disabled or not? Some servers return
an error saying the file does not exist
|
boolean |
isDisableChModAfterPut()
Is the permission change made after creating a file (which
is done to ensure the permissions are correct) disabled or not? Some servers return
an error saying the file does not exist
|
boolean |
isDisableWaitForChannelClose()
Is waiting for server acknowledge on closure of a channel disabled?
|
boolean |
isParallelWriteMode()
Is parallel write mode being used? Switch it off if any
problems are experienced.
|
boolean |
isPortsInKnownHosts()
Are non-standard port numbers used in known_hosts files? If
so then hosts are stored as [hostname]:port if the port number
is not 22.
|
boolean |
isRekeyEnabled()
Is re-keying after 1 GB enabled? If enabled (the default),
after 1 GB of transfer a new set of cryptographic keys are
established.
|
void |
setAlgorithmEnabled(SSHFTPAlgorithm algorithm,
boolean enable)
Enable/disable the given algorithm.
|
void |
setAuthenticationType(SSHAuthenticationType sshAuthenticationType)
Set the authentication type to be used.
|
void |
setCheckDirReadableForChDir(boolean checkDirReadableForChDir)
Set the flag that determines if a check is made when changing into a directory to see if the directory is readable.
|
void |
setCompressionDelayed(boolean compressionDelayed)
Set flag to force compression delayed until after authentication (if indeed
compression is to be used).
|
void |
setDisableChModAfterCreateDir(boolean disableChmodAfterCreateDir)
Set the permission change made after creating a directory (which is done to ensure the permissions are correct)
to disabled or enabled.
|
void |
setDisableChModAfterPut(boolean disableChmodAfterPut)
Set the permission change made after creating a file (which is done to ensure the permissions are correct)
to disabled or enabled.
|
void |
setDisableWaitForChannelClose(boolean disableWaitForChannelClose)
Disables waiting for an acknowledgement from the server when
the client has requested that a channel be closed.
|
void |
setMaxPacketSize(int maxPacketSize)
Set the maximum packet size.
|
void |
setMaxQueuedReadRequests(int maxQueuedReadRequests)
In SFTP, files are read block-by-block.
|
void |
setParallelWriteMode(boolean parallelWriteMode)
Set parallel write mode on or off.
|
void |
setPortsInKnownHosts(boolean portsInKnownHosts)
Change whether or not non-standard port numbers are used in known_hosts files.
|
void |
setPrivateKeyBytes(byte[] privateKeyBytes)
Reads the client's private key from the given byte-array.
|
void |
setPrivateKeyFile(java.lang.String privateKeyFileName)
Read the client's private key file, used for client authentication
if SSHAuthenticationType.PUBLIC_KEY is being used.
|
void |
setPrivateKeyFilePassphrase(java.lang.String privateKeyFilePassphrase)
Set the passphrase for the private key file.
|
void |
setPrivateKeyInputStream(java.io.InputStream privateKeyInputStream)
Read the client's private key from the given InputStream.
|
void |
setRekeyEnabled(boolean enableRekey)
Set flag to disable or enable re-keying after 1 GB
|
void |
setRemoteEOL(java.lang.String remoteEOL)
Set a remoteEOL to be forced, irrespective of what is detected from server information.
|
void |
setSSHAuthPrompts(SSHAuthPrompt[] authPrompts)
Set the array of authentication prompts that are to be used for keyboard-interactive
authentication.
|
void |
setSSHServerValidator(SSHFTPValidator validator)
Sets the host validator, which validates the server's public key.
|
void |
setUmask(java.lang.String umask)
Sets the umask used for permissions when creating files
|
public SSHFTPValidator getSSHServerValidator()
public void setSSHServerValidator(SSHFTPValidator validator)
validator - new validatorpublic boolean isDisableWaitForChannelClose()
public void setDisableWaitForChannelClose(boolean disableWaitForChannelClose)
throws FTPException
disableWaitForChannelClose - true to disable the waitFTPExceptionpublic boolean checkDirReadableForChDir()
public void setCheckDirReadableForChDir(boolean checkDirReadableForChDir)
public boolean isDisableChModAfterPut()
public void setDisableChModAfterPut(boolean disableChmodAfterPut)
throws FTPException
disableChmodAfterPut - true to disable the permission changeFTPExceptionpublic boolean isDisableChModAfterCreateDir()
public void setDisableChModAfterCreateDir(boolean disableChmodAfterCreateDir)
throws FTPException
disableChmodAfterPut - true to disable the permission changeFTPExceptionpublic boolean isRekeyEnabled()
public void setRekeyEnabled(boolean enableRekey)
enableRekey - true to enable, false to disablepublic boolean isParallelWriteMode()
public void setParallelWriteMode(boolean parallelWriteMode)
throws FTPException
parallelWriteMode - true to enable, false to disableFTPExceptionpublic int getMaxQueuedReadRequests()
public void setMaxQueuedReadRequests(int maxQueuedReadRequests)
throws FTPException
maxQueuedReadRequests - the maximum number of requests to sendFTPExceptionpublic java.lang.String getPrivateKeyFile()
setPrivateKeyFile was previously called).
The private key is used for client authentication
if SSHAuthenticationType.PUBLIC_KEY is being used.public void setPrivateKeyFile(java.lang.String privateKeyFileName)
throws FTPException
privateKeyFileName - path to fileFTPException - Thrown if an error occurs while reading the private key.public java.io.InputStream getPrivateKeyInputStream()
public void setPrivateKeyInputStream(java.io.InputStream privateKeyInputStream)
throws FTPException
privateKeyInputStream - InputStream from which the private key can be readFTPException - Thrown if an error occurs while reading the private key.public byte[] getPrivateKeyBytes()
public void setPrivateKeyBytes(byte[] privateKeyBytes)
throws FTPException
privateKeyBytes - Byte-array containing the client's private keyFTPException - Thrown if an error occurs while parsing the private key.public java.lang.String getPrivateKeyFilePassphrase()
public void setPrivateKeyFilePassphrase(java.lang.String privateKeyFilePassphrase)
throws FTPException
privateKeyFilePassphrase - passphrase to setFTPExceptionpublic boolean isCompressionDelayed()
public void setCompressionDelayed(boolean compressionDelayed)
throws FTPException
compressionDelayed - true to delay compression until after AUTH_SUCCESSFTPExceptionpublic SSHFTPAlgorithm[] getEnabledAlgorithms()
public SSHFTPAlgorithm[] getEnabledAlgorithms(int algorithmType) throws SSHFTPException
algorithmType - Type of algorithms to return (See SSHFTPAlgorithm).SSHFTPException - Thrown if the given algorithm-type is invalid.public void disableAllAlgorithms(int algorithmType)
throws FTPException
algorithmType - Type of algorithms to return (See SSHFTPAlgorithm).FTPExceptionpublic void disableAllAlgorithms()
throws FTPException
FTPExceptionpublic void setAlgorithmEnabled(SSHFTPAlgorithm algorithm, boolean enable) throws FTPException
algorithm - Algorithm to enable/disable.enable - Flag indicating whether the algorithm should be enabled or disabled.FTPExceptionpublic int getMaxPacketSize()
public void setMaxPacketSize(int maxPacketSize)
throws FTPException
maxPacketSize - size to setFTPExceptionpublic java.lang.String getUmask()
public void setUmask(java.lang.String umask)
umask - umask as 4 digit octal, e.g. 0022FTPExceptionpublic SSHAuthenticationType getAuthenticationType()
public void setAuthenticationType(SSHAuthenticationType sshAuthenticationType) throws FTPException
sshAuthenticationType - authentication type to be usedFTPExceptionpublic SSHAuthPrompt[] getSSHAuthPrompts()
public void setSSHAuthPrompts(SSHAuthPrompt[] authPrompts) throws FTPException
authPrompts - prompts to set upFTPExceptionpublic boolean isPortsInKnownHosts()
Default is true.
public void setPortsInKnownHosts(boolean portsInKnownHosts)
throws FTPException
portsInKnownHosts - true to enable, false to disableFTPExceptionpublic void setRemoteEOL(java.lang.String remoteEOL)
throws FTPException
remoteEOL - remoteEOL to forceFTPExceptionpublic java.lang.String getRemoteEOL()
Copyright © 2001-2014 Enterprise Distributed Technologies Ltd. All Rights Reserved.