public class FTPHTTPClient extends FTPClient
FTPClient.HostnameResolver, FTPClient.NatServerResolverImpl
Modifier and Type | Field and Description |
---|---|
private Base64 |
base64 |
private static byte[] |
CRLF |
private java.lang.String |
proxyHost |
private java.lang.String |
proxyPassword |
private int |
proxyPort |
private java.lang.String |
proxyUsername |
private java.lang.String |
tunnelHost |
ACTIVE_LOCAL_DATA_CONNECTION_MODE, ACTIVE_REMOTE_DATA_CONNECTION_MODE, FTP_SYSTEM_TYPE, FTP_SYSTEM_TYPE_DEFAULT, PASSIVE_LOCAL_DATA_CONNECTION_MODE, PASSIVE_REMOTE_DATA_CONNECTION_MODE, SYSTEM_TYPE_PROPERTIES
_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, LOCAL_FILE_TYPE, NON_PRINT_TEXT_FORMAT, PAGE_STRUCTURE, RECORD_STRUCTURE, REPLY_CODE_LEN, STREAM_TRANSFER_MODE, strictMultilineParsing, TELNET_TEXT_FORMAT
_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL
Constructor and Description |
---|
FTPHTTPClient(java.lang.String proxyHost,
int proxyPort) |
FTPHTTPClient(java.lang.String proxyHost,
int proxyPort,
java.lang.String proxyUser,
java.lang.String proxyPass) |
Modifier and Type | Method and Description |
---|---|
protected java.net.Socket |
_openDataConnection_(int command,
java.lang.String arg)
Deprecated.
(3.3) Use
FTPClient._openDataConnection_(FTPCmd, String) instead |
protected java.net.Socket |
_openDataConnection_(java.lang.String command,
java.lang.String arg)
Establishes a data connection with the FTP server, returning
a Socket for the connection if successful.
|
void |
connect(java.lang.String host,
int port)
Opens a Socket connected to a remote host at the specified port and
originating from the current host at a system assigned port.
|
private java.io.BufferedReader |
tunnelHandshake(java.lang.String host,
int port,
java.io.InputStream input,
java.io.OutputStream output) |
__createParser, __parsePathname, _connectAction_, _connectAction_, _openDataConnection_, _parseExtendedPassiveModeReply, _parsePassiveModeReply, _retrieveFile, _retrieveFileStream, _storeFile, _storeFileStream, abort, allocate, allocate, appendFile, appendFileStream, changeToParentDirectory, changeWorkingDirectory, completePendingCommand, configure, deleteFile, disconnect, doCommand, doCommandAsStrings, enterLocalActiveMode, enterLocalPassiveMode, enterRemoteActiveMode, enterRemotePassiveMode, features, featureValue, featureValues, getAutodetectUTF8, getBufferSize, getControlKeepAliveReplyTimeout, getControlKeepAliveTimeout, getCopyStreamListener, getDataConnectionMode, getEntryParser, getListArguments, getListHiddenFiles, getModificationTime, getPassiveHost, getPassiveLocalIPAddress, getPassivePort, getReceiveDataSocketBufferSize, getRestartOffset, getSendDataSocketBufferSize, getStatus, getStatus, getSystemName, getSystemType, hasFeature, hasFeature, initiateListParsing, initiateListParsing, initiateListParsing, isRemoteVerificationEnabled, isUseEPSVwithIPv4, listDirectories, listDirectories, listFiles, listFiles, listFiles, listHelp, listHelp, listNames, listNames, login, login, logout, makeDirectory, mdtmFile, mlistDir, mlistDir, mlistDir, mlistFile, printWorkingDirectory, reinitialize, remoteAppend, remoteRetrieve, remoteStore, remoteStoreUnique, remoteStoreUnique, removeDirectory, rename, restart, retrieveFile, retrieveFileStream, sendNoOp, sendSiteCommand, setActiveExternalIPAddress, setActivePortRange, setAutodetectUTF8, setBufferSize, setControlKeepAliveReplyTimeout, setControlKeepAliveTimeout, setCopyStreamListener, setDataTimeout, setFileStructure, setFileTransferMode, setFileType, setFileType, setListHiddenFiles, setModificationTime, setParserFactory, setPassiveLocalIPAddress, setPassiveLocalIPAddress, setPassiveNatWorkaround, setPassiveNatWorkaroundStrategy, setReceieveDataSocketBufferSize, setRemoteVerificationEnabled, setReportActiveExternalIPAddress, setRestartOffset, setSendDataSocketBufferSize, setUseEPSVwithIPv4, storeFile, storeFileStream, storeUniqueFile, storeUniqueFile, storeUniqueFileStream, storeUniqueFileStream, structureMount
__getReplyNoReport, __noop, abor, acct, allo, allo, appe, cdup, cwd, dele, eprt, epsv, feat, getCommandSupport, getControlEncoding, getReply, getReplyCode, getReplyString, getReplyStrings, help, help, isStrictMultilineParsing, isStrictReplyParsing, list, list, mdtm, mfmt, mkd, mlsd, mlsd, mlst, mlst, mode, nlst, nlst, noop, pass, pasv, port, pwd, quit, rein, rest, retr, rmd, rnfr, rnto, sendCommand, sendCommand, sendCommand, sendCommand, sendCommand, sendCommand, setControlEncoding, setStrictMultilineParsing, setStrictReplyParsing, site, smnt, stat, stat, stor, stou, stou, stru, syst, type, type, user
addProtocolCommandListener, connect, connect, connect, connect, connect, createCommandSupport, fireCommandSent, fireReplyReceived, getCharset, getCharsetName, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
private final java.lang.String proxyHost
private final int proxyPort
private final java.lang.String proxyUsername
private final java.lang.String proxyPassword
private static final byte[] CRLF
private final Base64 base64
private java.lang.String tunnelHost
public FTPHTTPClient(java.lang.String proxyHost, int proxyPort, java.lang.String proxyUser, java.lang.String proxyPass)
public FTPHTTPClient(java.lang.String proxyHost, int proxyPort)
@Deprecated protected java.net.Socket _openDataConnection_(int command, java.lang.String arg) throws java.io.IOException
FTPClient._openDataConnection_(FTPCmd, String)
insteadFTPClient.setRestartOffset(long)
,
a REST command is issued to the server with the offset as
an argument before establishing the data connection. Active
mode connections also cause a local PORT command to be issued._openDataConnection_
in class FTPClient
command
- The int representation of the FTP command to send.arg
- The arguments to the FTP command. If this parameter is
set to null, then the command is sent with no argument.java.lang.IllegalStateException
- if connection mode is not passivejava.io.IOException
- If an I/O error occurs while either sending a
command to the server or receiving a reply from the server.protected java.net.Socket _openDataConnection_(java.lang.String command, java.lang.String arg) throws java.io.IOException
FTPClient.setRestartOffset(long)
,
a REST command is issued to the server with the offset as
an argument before establishing the data connection. Active
mode connections also cause a local PORT command to be issued._openDataConnection_
in class FTPClient
command
- The text representation of the FTP command to send.arg
- The arguments to the FTP command. If this parameter is
set to null, then the command is sent with no argument.java.lang.IllegalStateException
- if connection mode is not passivejava.io.IOException
- If an I/O error occurs while either sending a
command to the server or receiving a reply from the server.public void connect(java.lang.String host, int port) throws java.net.SocketException, java.io.IOException
SocketClient
_connectAction_()
is called to perform connection initialization actions.
connect
in class SocketClient
host
- The name of the remote host.port
- The port to connect to on the remote host.java.net.SocketException
- If the socket timeout could not be set.java.io.IOException
- If the socket could not be opened. In most
cases you will only want to catch IOException since SocketException is
derived from it.java.net.UnknownHostException
- If the hostname cannot be resolved.private java.io.BufferedReader tunnelHandshake(java.lang.String host, int port, java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException, java.io.UnsupportedEncodingException
java.io.IOException
java.io.UnsupportedEncodingException