org.apache.commons.net.ftp
Class FTPHTTPClient

java.lang.Object
  extended by org.apache.commons.net.SocketClient
      extended by org.apache.commons.net.ftp.FTP
          extended by org.apache.commons.net.ftp.FTPClient
              extended by org.apache.commons.net.ftp.FTPHTTPClient
All Implemented Interfaces:
Configurable

public class FTPHTTPClient
extends FTPClient

Experimental attempt at FTP client that tunnels over an HTTP proxy connection.

Since:
2.2
Author:
rory

Field Summary
 
Fields inherited from class org.apache.commons.net.ftp.FTPClient
ACTIVE_LOCAL_DATA_CONNECTION_MODE, ACTIVE_REMOTE_DATA_CONNECTION_MODE, PASSIVE_LOCAL_DATA_CONNECTION_MODE, PASSIVE_REMOTE_DATA_CONNECTION_MODE
 
Fields inherited from class org.apache.commons.net.ftp.FTP
_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, STREAM_TRANSFER_MODE, strictMultilineParsing, TELNET_TEXT_FORMAT
 
Fields inherited from class org.apache.commons.net.SocketClient
_defaultPort_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL
 
Constructor Summary
FTPHTTPClient(java.lang.String proxyHost, int proxyPort)
           
FTPHTTPClient(java.lang.String proxyHost, int proxyPort, java.lang.String proxyUser, java.lang.String proxyPass)
           
 
Method Summary
protected  java.net.Socket _openDataConnection_(int 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.
 
Methods inherited from class org.apache.commons.net.ftp.FTPClient
_connectAction_, abort, allocate, allocate, appendFile, appendFileStream, changeToParentDirectory, changeWorkingDirectory, completePendingCommand, configure, deleteFile, disconnect, enterLocalActiveMode, enterLocalPassiveMode, enterRemoteActiveMode, enterRemotePassiveMode, features, getBufferSize, getDataConnectionMode, getListArguments, getListHiddenFiles, getModificationTime, getPassiveHost, getPassivePort, getRestartOffset, getStatus, getStatus, getSystemName, getSystemType, initiateListParsing, initiateListParsing, initiateListParsing, isRemoteVerificationEnabled, isUseEPSVwithIPv4, listFiles, listFiles, listFiles, listHelp, listHelp, listNames, listNames, login, login, logout, makeDirectory, printWorkingDirectory, remoteAppend, remoteRetrieve, remoteStore, remoteStoreUnique, remoteStoreUnique, removeDirectory, rename, retrieveFile, retrieveFileStream, sendNoOp, sendSiteCommand, setActiveExternalIPAddress, setActivePortRange, setBufferSize, setDataTimeout, setFileStructure, setFileTransferMode, setFileType, setFileType, setListHiddenFiles, setModificationTime, setParserFactory, setRemoteVerificationEnabled, setRestartOffset, setUseEPSVwithIPv4, storeFile, storeFileStream, storeUniqueFile, storeUniqueFile, storeUniqueFileStream, storeUniqueFileStream, structureMount
 
Methods inherited from class org.apache.commons.net.ftp.FTP
abor, acct, addProtocolCommandListener, allo, allo, appe, cdup, cwd, dele, eprt, epsv, feat, getControlEncoding, getReply, getReplyCode, getReplyString, getReplyStrings, help, help, isStrictMultilineParsing, list, list, mdtm, mfmt, mkd, mode, nlst, nlst, noop, pass, pasv, port, pwd, quit, rein, removeProtocolCommandListener, rest, retr, rmd, rnfr, rnto, sendCommand, sendCommand, sendCommand, sendCommand, setControlEncoding, setStrictMultilineParsing, site, smnt, stat, stat, stor, stou, stou, stru, syst, type, type, user
 
Methods inherited from class org.apache.commons.net.SocketClient
connect, connect, connect, connect, connect, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getRemoteAddress, getRemotePort, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isConnected, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPHTTPClient

public FTPHTTPClient(java.lang.String proxyHost,
                     int proxyPort,
                     java.lang.String proxyUser,
                     java.lang.String proxyPass)

FTPHTTPClient

public FTPHTTPClient(java.lang.String proxyHost,
                     int proxyPort)
Method Detail

_openDataConnection_

protected java.net.Socket _openDataConnection_(int command,
                                               java.lang.String arg)
                                        throws java.io.IOException
Description copied from class: FTPClient
Establishes a data connection with the FTP server, returning a Socket for the connection if successful. If a restart offset has been set with 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.

Overrides:
_openDataConnection_ in class FTPClient
Parameters:
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.
Returns:
A Socket corresponding to the established data connection. Null is returned if an FTP protocol error is reported at any point during the establishment and initialization of the connection.
Throws:
java.io.IOException - If an I/O error occurs while either sending a command to the server or receiving a reply from the server.

connect

public void connect(java.lang.String host,
                    int port)
             throws java.net.SocketException,
                    java.io.IOException
Description copied from class: SocketClient
Opens a Socket connected to a remote host at the specified port and originating from the current host at a system assigned port. Before returning, _connectAction_() is called to perform connection initialization actions.

Overrides:
connect in class SocketClient
Parameters:
host - The name of the remote host.
port - The port to connect to on the remote host.
Throws:
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.


Copyright © 2001-2011 Apache Software Foundation. All Rights Reserved.