public class FTPSClient extends FTPClient
Modifier and Type | Field and Description |
---|---|
static String |
KEYSTORE_ALGORITHM
keystore algorithm name.
|
static String |
PROVIDER
provider name.
|
static String |
STORE_TYPE
truststore type.
|
static String |
TRUSTSTORE_ALGORITHM
truststore algorithm name.
|
ACTIVE_LOCAL_DATA_CONNECTION_MODE, ACTIVE_REMOTE_DATA_CONNECTION_MODE, PASSIVE_LOCAL_DATA_CONNECTION_MODE, PASSIVE_REMOTE_DATA_CONNECTION_MODE
_commandSupport_, _controlEncoding, _controlInput_, _controlOutput_, _newReplyString, _replyCode, _replyLines, _replyString, ASCII_FILE_TYPE, BINARY_FILE_TYPE, BLOCK_TRANSFER_MODE, CARRIAGE_CONTROL_TEXT_FORMAT, COMPRESSED_TRANSFER_MODE, DEFAULT_CONTROL_ENCODING, DEFAULT_DATA_PORT, DEFAULT_PORT, EBCDIC_FILE_TYPE, FILE_STRUCTURE, IMAGE_FILE_TYPE, LOCAL_FILE_TYPE, NON_PRINT_TEXT_FORMAT, PAGE_STRUCTURE, RECORD_STRUCTURE, STREAM_TRANSFER_MODE, strictMultilineParsing, TELNET_TEXT_FORMAT
_defaultPort_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL
Constructor and Description |
---|
FTPSClient()
Constructor for FTPSClient.
|
FTPSClient(boolean isImplicit)
Constructor for FTPSClient.
|
FTPSClient(String protocol)
Constructor for FTPSClient.
|
FTPSClient(String protocol,
boolean isImplicit)
Constructor for FTPSClient.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_connectAction_()
Because there are so many connect() methods,
the _connectAction_() method is provided as a means of performing
some action immediately after establishing a connection,
rather than reimplementing all of the connect() methods.
|
protected Socket |
_openDataConnection_(int command,
String arg)
Returns a socket of the data connection.
|
void |
execPBSZ(long pbsz)
PBSZ command.
|
void |
execPROT(String prot)
PROT command.
C - Clear
S - Safe(SSL protocol only)
E - Confidential(SSL protocol only)
P - Private
|
String |
getAuthValue()
Return AUTH command use value.
|
String[] |
getEnabledCipherSuites()
Returns the names of the cipher suites which could be enabled
for use on this connection.
|
String[] |
getEnabledProtocols()
Returns the names of the protocol versions which are currently
enabled for use on this connection.
|
boolean |
getEnableSessionCreation()
Returns true if new SSL sessions may be established by this socket.
|
boolean |
getNeedClientAuth()
Returns true if the socket will require client authentication.
|
TrustManager |
getTrustManager()
Get the currently configured
TrustManager . |
boolean |
getUseClientMode()
Returns true if the socket is set to use client mode
in its first handshake.
|
boolean |
getWantClientAuth()
Returns true if the socket will request client authentication.
|
int |
sendCommand(String command,
String args)
I carry out an ftp command.
|
void |
setAuthValue(String auth)
Set AUTH command use value.
|
void |
setEnabledCipherSuites(String[] cipherSuites)
Controls which particular cipher suites are enabled for use on this
connection.
|
void |
setEnabledProtocols(String[] protocolVersions)
Controls which particular protocol versions are enabled for use on this
connection.
|
void |
setEnabledSessionCreation(boolean isCreation)
Controls whether new a SSL session may be established by this socket.
|
void |
setKeyManager(KeyManager keyManager)
Set a
KeyManager to use |
void |
setNeedClientAuth(boolean isNeedClientAuth)
Configures the socket to require client authentication.
|
void |
setTrustManager(TrustManager trustManager)
Override the default
TrustManager to use. |
void |
setUseClientMode(boolean isClientMode)
Configures the socket to use client (or server) mode in its first
handshake.
|
void |
setWantClientAuth(boolean isWantClientAuth)
Configures the socket to request client authentication,
but only if such a request is appropriate to the cipher
suite negotiated.
|
abort, allocate, allocate, appendFile, appendFileStream, changeToParentDirectory, changeWorkingDirectory, completePendingCommand, configure, deleteFile, disconnect, enterLocalActiveMode, enterLocalPassiveMode, enterRemoteActiveMode, enterRemotePassiveMode, getBufferSize, getDataConnectionMode, getListArguments, getListHiddenFiles, getModificationTime, getPassiveHost, getPassivePort, getRestartOffset, getStatus, getStatus, getSystemName, initiateListParsing, initiateListParsing, initiateListParsing, isRemoteVerificationEnabled, listFiles, listFiles, listHelp, listHelp, listNames, listNames, login, login, logout, makeDirectory, printWorkingDirectory, remoteAppend, remoteRetrieve, remoteStore, remoteStoreUnique, remoteStoreUnique, removeDirectory, rename, retrieveFile, retrieveFileStream, sendNoOp, sendSiteCommand, setBufferSize, setDataTimeout, setFileStructure, setFileTransferMode, setFileType, setFileType, setListHiddenFiles, setParserFactory, setRemoteVerificationEnabled, setRestartOffset, storeFile, storeFileStream, storeUniqueFile, storeUniqueFile, storeUniqueFileStream, storeUniqueFileStream, structureMount
abor, acct, addProtocolCommandListener, allo, allo, appe, cdup, cwd, dele, getControlEncoding, getReply, getReplyCode, getReplyString, getReplyStrings, help, help, isStrictMultilineParsing, list, list, mdtm, mkd, mode, nlst, nlst, noop, pass, pasv, port, pwd, quit, rein, removeProtocolCommandListener, rest, retr, rmd, rnfr, rnto, sendCommand, sendCommand, sendCommand, setControlEncoding, setStrictMultilineParsing, site, smnt, stat, stat, stor, stou, stou, stru, syst, type, type, user
connect, connect, connect, connect, connect, connect, getConnectTimeout, getDefaultPort, getDefaultTimeout, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setConnectTimeout, setDefaultPort, setDefaultTimeout, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
public static String KEYSTORE_ALGORITHM
public static String TRUSTSTORE_ALGORITHM
public static String PROVIDER
public static String STORE_TYPE
public FTPSClient() throws NoSuchAlgorithmException
NoSuchAlgorithmException
- A requested cryptographic algorithm
is not available in the environment.public FTPSClient(boolean isImplicit) throws NoSuchAlgorithmException
isImplicit
- The secutiry mode(Implicit/Explicit).NoSuchAlgorithmException
- A requested cryptographic algorithm
is not available in the environment.public FTPSClient(String protocol) throws NoSuchAlgorithmException
protocol
- the protocolNoSuchAlgorithmException
- A requested cryptographic algorithm
is not available in the environment.public FTPSClient(String protocol, boolean isImplicit) throws NoSuchAlgorithmException
protocol
- the protocolisImplicit
- The secutiry mode(Implicit/Explicit).NoSuchAlgorithmException
- A requested cryptographic algorithm
is not available in the environment.public void setAuthValue(String auth)
auth
- AUTH command use value.public String getAuthValue()
protected void _connectAction_() throws IOException
_connectAction_
in class FTPClient
IOException
- If it throw by _connectAction_.SocketClient._connectAction_()
public void setKeyManager(KeyManager keyManager)
KeyManager
to usekeyManager
- The KeyManager implementation to set.public void setEnabledSessionCreation(boolean isCreation)
isCreation
- The established socket flag.public boolean getEnableSessionCreation()
public void setNeedClientAuth(boolean isNeedClientAuth)
isNeedClientAuth
- The need client auth flag.public boolean getNeedClientAuth()
public void setWantClientAuth(boolean isWantClientAuth)
isWantClientAuth
- The want client auth flag.public boolean getWantClientAuth()
public void setUseClientMode(boolean isClientMode)
isClientMode
- The use client mode flag.public boolean getUseClientMode()
public void setEnabledCipherSuites(String[] cipherSuites)
cipherSuites
- The cipher suites.public String[] getEnabledCipherSuites()
public void setEnabledProtocols(String[] protocolVersions)
protocolVersions
- The protocol versions.public String[] getEnabledProtocols()
public void execPBSZ(long pbsz) throws SSLException, IOException
pbsz
- Protection Buffer Size.SSLException
- If it server reply code not equal "200".IOException
- If an I/O error occurs while either sending
the command.public void execPROT(String prot) throws SSLException, IOException
prot
- Data Channel Protection Level.SSLException
- If it server reply code not equal "200".IOException
- If an I/O error occurs while either sending
the command.public int sendCommand(String command, String args) throws IOException
sendCommand
in class FTP
command
- The text representation of the FTP command to send.args
- The arguments to the FTP command. If this parameter is
set to null, then the command is sent with no argument.IOException
- If an I/O error occurs while either sending
the command.FTP.sendCommand(java.lang.String)
protected Socket _openDataConnection_(int command, String arg) throws IOException
SSLSocket
, which carries out handshake processing._openDataConnection_
in class FTPClient
arg
- The arguments to the FTP command.
If this parameter is set to null, then the command is sent with
no argument.command
- The text representation of the FTP command to send.IOException
- If there is any problem with the connection.org.apache.commons.net.ftp.FTPClient#_openDataConnection_(java.lang.String, int)
public TrustManager getTrustManager()
TrustManager
.public void setTrustManager(TrustManager trustManager)
TrustManager
to use.trustManager
- The TrustManager implementation to set.Copyright © 1997-2012 Apache Software Foundation. All Rights Reserved.