|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.glub.secureftp.bean.FTP
public class FTP
The FTP
class is responsible for handling the basic operations
of the File Transfer Protocol.
Field Summary | |
---|---|
static short |
ACTIVE_CONNECTION_TYPE
Used to set the data connection type to active . |
static short |
ASCII_TRANSFER_MODE
Used to set the data transfer mode to ascii . |
static short |
AUTO_TRANSFER_MODE
Used to set the data transfer mode to auto . |
static short |
BINARY_TRANSFER_MODE
Used to set the data transfer mode to binary ; also
known as image . |
protected FTPCommand |
command
This handles the FTP commands. |
static short |
EBCDIC_TRANSFER_MODE
Used to set the data transfer mode to ebcdic . |
protected boolean |
isConnected
If we are connected, this is true. |
protected boolean |
isLoggedIn
If we are logged in, this is true. |
protected int |
lastPortFromRange
These values are used if an active port range is specifed |
protected int |
maxPortInRange
|
protected int |
minPortInRange
|
protected boolean |
modeZEnabled
If mode z is enabled, this is true. |
static short |
PASSIVE_CONNECTION_TYPE
Used to set the data connection type to passive . |
static short |
PASV_CONNECTION_TYPE
Used to set the data connection type to passive . |
protected OutputStream |
recvCmdStream
This stream is used to print the responses returned from the server. |
protected OutputStream |
sendCmdStream
This stream is used to print the commands sent to the server. |
Constructor Summary | |
---|---|
FTP(HostInfo hostInfo)
Create a new FTP object without response notification. |
|
FTP(HostInfo hostInfo,
OutputStream sendCmdStream,
OutputStream recvCmdStream)
Create a new FTP object with response notification. |
|
FTP(String host,
int port)
Create a new FTP object without response notification. |
|
FTP(String host,
int port,
OutputStream sendCmdStream,
OutputStream recvCmdStream)
Create a new FTP object with response notification. |
Method Summary | |
---|---|
void |
abort(FTPAbortableTransfer abort)
Abort a data transfer from the FTP server. |
protected void |
aboutToTransferData()
Called before data transfers begin. |
void |
append(File file,
RemoteFile appendTo)
Append to a file on the FTP server. |
void |
append(File file,
RemoteFile appendTo,
FTPAbortableTransfer abort)
Append to a file on the FTP server with the ability to abort the data transfer. |
void |
append(File file,
RemoteFile appendTo,
Progress progress)
Append to a file on the FTP server with progress information. |
void |
append(File file,
RemoteFile appendTo,
Progress progress,
FTPAbortableTransfer abort)
Append to a file on the FTP server with progress information and the ability to abort the data transfer. |
void |
append(File file,
String appendTo)
Append to a file on the FTP server. |
void |
append(File file,
String appendTo,
FTPAbortableTransfer abort)
Append to a file on the FTP server with the ability to abort the data transfer. |
void |
append(File file,
String appendTo,
Progress progress)
Append to a file on the FTP server with progress information. |
void |
append(File file,
String appendTo,
Progress progress,
FTPAbortableTransfer abort)
Append to a file on the FTP server with progress information and the ability to abort the data transfer. |
void |
append(InputStream inputStream,
long localFileSize,
RemoteFile appendTo,
Progress progress)
Append to a file on the FTP server with progress information. |
void |
append(InputStream inputStream,
long localFileSize,
RemoteFile appendTo,
Progress progress,
FTPAbortableTransfer abort)
Append to a file on the FTP server with progress information and the ability to abort the data transfer. |
void |
append(InputStream inputStream,
long localFileSize,
String appendTo,
Progress progress)
Append to a file on the FTP server with progress information. |
void |
append(InputStream inputStream,
long localFileSize,
String appendTo,
Progress progress,
FTPAbortableTransfer abort)
Append to a file on the FTP server with progress information and the ability to abort the data transfer. |
void |
append(InputStream inputStream,
RemoteFile appendTo)
Append to a file on the FTP server. |
void |
append(InputStream inputStream,
RemoteFile appendTo,
FTPAbortableTransfer abort)
Append to a file on the FTP server with the ability to abort the data transfer. |
void |
append(InputStream inputStream,
String appendTo)
Append to a file on the FTP server. |
void |
append(InputStream inputStream,
String appendTo,
FTPAbortableTransfer abort)
Append to a file on the FTP server with the ability to abort the data transfer. |
void |
ascii()
Set the data transfer mode to ascii. |
void |
auto()
Set the data transfer mode to auto. |
void |
binary()
Set the data transfer mode to binary (or image). |
void |
cdup()
Change up one directory on the FTP server. |
void |
chdir(RemoteFile dir)
Change to a remote directory on the FTP server. |
void |
chdir(String dir)
Change to a remote directory on the FTP server. |
void |
connect()
Connect to the FTP host and port. |
void |
delete(RemoteFile fileName)
Delete a file from the FTP server. |
void |
delete(String fileName)
Delete a file from the FTP server. |
void |
ebcdic()
Set the data transfer mode to ebcdic. |
void |
forcePasvToUseControlIP(boolean on)
Forces passive data transfers to use the control socket IP address. |
String |
getAccount()
Get the account name. |
int |
getConnectionType()
The data connection type is either passive or active. |
Socket |
getControlSocket()
Get the control socket. |
static String |
getDateStamp()
The datestamp of the bean. |
FTPCommand |
getFTPCommand()
Get the FTPCommand object. |
String |
getHostName()
Get the hostname of the FTP server. |
short |
getListStyle()
Get the server listing style of the FTP server. |
String |
getPassword()
Get the password. |
int |
getPort()
Get the port of the FTP server. |
protected int |
getPortFromRange()
|
short |
getTransferMode()
The data transfer mode is either auto, ascii, or binary (image). |
String |
getUser()
Get the username. |
static String |
getVersion()
The version of the bean. |
String |
help(String item)
Get the server's remote help. |
boolean |
isConnected()
Whether or not currently connected. |
boolean |
isLoggedIn()
Whether or not currently logged in. |
boolean |
isTransferRestartable()
Whether or not the server supports restarting broken data transfers. |
RemoteFileList |
list()
List the current remote directory. |
RemoteFileList |
list(FTPAbortableTransfer abort)
List the current remote directory with the ability to abort the listing. |
RemoteFileList |
list(RemoteFile file)
List items on the remote FTP server. |
RemoteFileList |
list(RemoteFile file,
FTPAbortableTransfer abort,
boolean showHidden)
List items on the remote FTP server with the ability to abort the listing. |
RemoteFileList |
list(String itemsToList)
List items on the remote FTP server. |
RemoteFileList |
list(String itemsToList,
FTPAbortableTransfer abort,
boolean showHidden)
List items on the remote FTP server with the ability to abort the listing. |
RemoteFileList |
listAll()
List the current remote directory, including hidden files. |
RemoteFileList |
listAll(FTPAbortableTransfer abort)
List the current remote directory including hidden files with the ability to abort the listing. |
void |
login(String user,
String pass)
Login to the FTP server. |
void |
login(String user,
String pass,
String acct)
Login to the FTP server. |
void |
logout()
Logout from the FTP server. |
protected Socket |
makeControlSocket(HostInfo hostInfo)
Make a new control socket. |
protected ServerSocket |
makeDataServerSocket(HostInfo hostInfo)
Make a new data server socket. |
protected Socket |
makeDataSocket(HostInfo hostInfo)
Make a new data socket. |
protected FTPCommand |
makeFTPCommand(BufferedReader inputReader,
PrintWriter outputWriter)
Set the FTPCommand object. |
void |
mkdir(String newDir)
Make a new directory on the FTP server. |
void |
modeZ()
Set mode z (on-the-fly compression) data transfer. |
void |
noop()
Send a noop command to the FTP server. |
protected HostInfo |
pasv()
Setup a pasv data connection. |
protected void |
port(HostInfo hostInfo)
Setup an active data connection. |
String |
pwd()
Get the current directory on the FTP server. |
void |
raw(String rawCmd)
Send a raw command to the FTP server. |
void |
rename(String from,
String to)
Rename a file on the FTP server. |
void |
retrieve(RemoteFile remoteFile,
File outputFile,
boolean restartXfer)
Retrieve a file from the FTP server. |
void |
retrieve(RemoteFile remoteFile,
File outputFile,
boolean restartXfer,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with the ability to abort the transfer. |
void |
retrieve(RemoteFile remoteFile,
File outputFile,
boolean restartXfer,
Progress progress)
Retrieve a file from the FTP server with progress information. |
void |
retrieve(RemoteFile remoteFile,
File outputFile,
boolean restartXfer,
Progress progress,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with progress information and the ability to abort the transfer. |
void |
retrieve(RemoteFile remoteFile,
OutputStream outputStream)
Retrieve a file from the FTP server. |
void |
retrieve(RemoteFile remoteFile,
OutputStream outputStream,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with the ability to abort the transfer. |
void |
retrieve(RemoteFile remoteFile,
OutputStream outputStream,
Progress progress)
Retrieve a file from the FTP server with progress information. |
void |
retrieve(RemoteFile remoteFile,
OutputStream outputStream,
Progress progress,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with progress information and the ability to abort the transfer. |
void |
retrieve(String remoteFile,
File outputFile,
boolean restartXfer)
Retrieve a file from the FTP server. |
void |
retrieve(String remoteFile,
File outputFile,
boolean restartXfer,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with the ability to abort the transfer. |
void |
retrieve(String remoteFile,
File outputFile,
boolean restartXfer,
Progress progress)
Retrieve a file from the FTP server with progress information. |
void |
retrieve(String remoteFile,
File outputFile,
boolean restartXfer,
Progress progress,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with progress information and the ability to abort the transfer. |
void |
retrieve(String remoteFile,
OutputStream outputStream)
Retrieve a file from the FTP server. |
void |
retrieve(String remoteFile,
OutputStream outputStream,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with the ability to abort the transfer. |
void |
retrieve(String remoteFile,
OutputStream outputStream,
Progress progress)
Retrieve a file from the FTP server with progress information. |
void |
retrieve(String remoteFile,
OutputStream outputStream,
Progress progress,
FTPAbortableTransfer abort)
Retrieve a file from the FTP server with progress information and the ability to abort the transfer. |
void |
rmdir(RemoteFile dir)
Remote a directory from the FTP server. |
void |
rmdir(String dir)
Remote a directory from the FTP server. |
void |
sendAccount(String acct)
Sends the account to the FTP server. |
void |
sendPassword(String pass)
Sends the password to the FTP server. |
void |
sendUserName(String user)
Sends the username to the FTP server. |
void |
setAccount(String account)
Set the account name. |
void |
setActivePortRange(int minPort,
int maxPort)
Set a range of ports to use during active (port) data connections. |
void |
setConnectionType(short type)
Set the data connection type. |
protected void |
setControlSocket(Socket controlSocket)
Set the control socket. |
void |
setHostName(String hostName)
Set the hostname of the FTP server. |
void |
setListStyle(short listStyle)
Set the server type to help with the listing style of the FTP server. |
void |
setPassword(String password)
Set the password. |
void |
setPort(int port)
Set the port of the FTP server. |
void |
setRecvCmdStream(OutputStream recvCmdStream)
Set the stream responsible for handling respones from the FTP server. |
void |
setSendCmdStream(OutputStream sendCmdStream)
Set the stream responsible for handling commands sent to the FTP server. |
void |
setSocksIVProxy(String host,
int port)
Set the Socks IV server proxy. |
void |
setSocksVProxy(String host,
int port,
String username,
String password)
Set the Socks V server proxy. |
void |
setStringDataAsUTF8(boolean on)
Set server to treat string data in UTF8 format |
void |
setUser(String user)
Set the username. |
long |
size(RemoteFile file)
Get the size of a file on the FTP server. |
long |
size(String file)
Get the size of a file on the FTP server. |
void |
store(File file,
boolean restartXfer)
Store a file to the FTP server. |
void |
store(File file,
boolean restartXfer,
FTPAbortableTransfer abort)
Store a file to the FTP server with the ability to abort the data transfer. |
void |
store(File file,
boolean restartXfer,
Progress progress)
Store a file to the FTP server with progress information. |
void |
store(File file,
boolean restartXfer,
Progress progress,
FTPAbortableTransfer abort)
Store a file to the FTP server with progress information and the ability to abort the data transfer. |
void |
store(File file,
String name,
boolean restartXfer)
Store a file to the FTP server with a specific filename. |
void |
store(File file,
String name,
boolean restartXfer,
FTPAbortableTransfer abort)
Store a file to the FTP server with a specific filename and with the ability to abort the data transfer. |
void |
store(File file,
String name,
boolean restartXfer,
Progress progress)
Store a file to the FTP server with a specific filename and with progress information. |
void |
store(File file,
String name,
boolean restartXfer,
Progress progress,
FTPAbortableTransfer abort)
Store a file to the FTP server with a specific filename and progress information and the ability to abort the data transfer. |
void |
store(InputStream inputStream)
Store a file to the FTP server. |
void |
store(InputStream inputStream,
FTPAbortableTransfer abort)
Store a file to the FTP server with the ability to abort the data transfer. |
void |
store(InputStream inputStream,
long localFileSize,
Progress progress)
Store a file to the FTP server with progress information. |
void |
store(InputStream inputStream,
long localFileSize,
Progress progress,
FTPAbortableTransfer abort)
Store a file to the FTP server with progress information and the ability to abort the data transfer. |
void |
store(InputStream inputStream,
long localFileSize,
String name,
Progress progress)
Store a file to the FTP server with a specific filename and with progress information. |
void |
store(InputStream inputStream,
long localFileSize,
String name,
Progress progress,
FTPAbortableTransfer abort)
Store a file to the FTP server with a specific filename and progress information and the ability to abort the data transfer. |
void |
store(InputStream inputStream,
String name)
Store a file to the FTP server with a specific filename. |
void |
store(InputStream inputStream,
String name,
FTPAbortableTransfer abort)
Store a file to the FTP server with a specific filename and with the ability to abort the data transfer. |
boolean |
stringDataAsUTF8()
Whether or not the server is treating the string data as UTF8 |
Date |
time(RemoteFile file)
Get the modification time of a file on the FTP server. |
Date |
time(String file)
Get the modification time of a file on the FTP server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short ASCII_TRANSFER_MODE
ascii
.
public static final short BINARY_TRANSFER_MODE
binary
; also
known as image
.
public static final short AUTO_TRANSFER_MODE
auto
. This mode
attempts to guess which transfer mode (ascii or binary) to set
based on file type.
public static final short EBCDIC_TRANSFER_MODE
ebcdic
.
public static final short PASV_CONNECTION_TYPE
passive
.
public static final short PASSIVE_CONNECTION_TYPE
passive
.
public static final short ACTIVE_CONNECTION_TYPE
active
.
protected boolean modeZEnabled
protected boolean isConnected
protected boolean isLoggedIn
protected int lastPortFromRange
protected int minPortInRange
protected int maxPortInRange
protected OutputStream recvCmdStream
protected OutputStream sendCmdStream
protected FTPCommand command
Constructor Detail |
---|
public FTP(HostInfo hostInfo)
FTP
object without response notification.
hostInfo
- the HostInfo to connect to.public FTP(String host, int port)
FTP
object without response notification.
host
- the hostname to connect to.port
- the port to connect to.public FTP(HostInfo hostInfo, OutputStream sendCmdStream, OutputStream recvCmdStream)
FTP
object with response notification.
hostInfo
- the HostInfo to connect to.sendCmdStream
- the commands sent to the server.
Pass null
if not interested
in this data.recvCmdStream
- the responses returned from the server.
Pass null
if not interested
in this data.public FTP(String host, int port, OutputStream sendCmdStream, OutputStream recvCmdStream)
FTP
object with response notification.
host
- the hostname to connect to.port
- the port to connect to.sendCmdStream
- the commands sent to the server.
Pass null
if not interested
in this data.recvCmdStream
- the responses returned from the server.
Pass null
if not interested
in this data.Method Detail |
---|
public void connect() throws FTPConnectException, FTPException, IOException, UnknownHostException, IllegalArgumentException
FTPConnectException
- if the connection fails.
FTPException
- if the FTP server returns an error code.
IOException
- if there are socket problems.
UnknownHostException
- if the host could not be found.
IllegalArgumentException
- if hostName
is
null
.public void login(String user, String pass) throws IOException, FTPBadLoginException, FTPConnectException, FTPException, IllegalArgumentException
user
- the username to login as.pass
- the password to login as.
IOException
- if there is a socket problem.
FTPBadLoginException
- if there is a problem logging in.
FTPConnectException
- if this is called prior to
connect
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with any of the
passed in args.connect()
public void login(String user, String pass, String acct) throws IOException, FTPBadLoginException, FTPConnectException, FTPException, IllegalArgumentException
user
- the username to login as.pass
- the password to login as.acct
- the account to use.
IOException
- if there is a socket problem.
FTPBadLoginException
- if there is a problem logging in.
FTPConnectException
- if this is called prior to
connect
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with any of the
passed in args.connect()
public void logout() throws IOException, FTPException
IOException
- if there is a socket problem.
FTPException
- if the FTP server returns an error code.public void sendUserName(String user) throws FTPNeedPasswordException, FTPNeedAccountException, FTPBadLoginException, FTPException, IllegalArgumentException
user
- the username.
FTPNeedPasswordException
- if a password is required.
FTPNeedAccountException
- if an accound is required.
FTPBadLoginException
- if there is a problem logging in.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the username.public void sendPassword(String pass) throws FTPNeedAccountException, FTPBadLoginException, FTPException, IllegalArgumentException
pass
- the password.
FTPNeedAccountException
- if an accound is required.
FTPBadLoginException
- if there is a problem logging in.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the password.public void sendAccount(String acct) throws FTPBadLoginException, FTPException, IllegalArgumentException
acct
- the account.
FTPBadLoginException
- if there is a problem logging in.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the account.public RemoteFileList listAll() throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public RemoteFileList list() throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public RemoteFileList list(FTPAbortableTransfer abort) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
abort
- an Object that allows for the abortion of the
list
.
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public RemoteFileList listAll(FTPAbortableTransfer abort) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
abort
- an Object that allows for the abortion of the
list
.
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public RemoteFileList list(RemoteFile file) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- a RemoteFile
you
want to to list from the FTP server.
Pass null
to list the current directory.
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public RemoteFileList list(String itemsToList) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
itemsToList
- a space-delimited String
of items you
want to to list from the FTP server.
Pass null
to list the current directory.
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public RemoteFileList list(RemoteFile file, FTPAbortableTransfer abort, boolean showHidden) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- a RemoteFile
want to to list from the
FTP server.abort
- an Object that allows for the abortion of the
list
.showHidden
- flag to show hidden files (only useful for empty list)
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public RemoteFileList list(String itemsToList, FTPAbortableTransfer abort, boolean showHidden) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
itemsToList
- a space-delimited String
of items you
want to to list from the FTP server.
Pass null
to list the current directory.abort
- an Object that allows for the abortion of the
list
.showHidden
- flag to show hidden files (only useful for empty list)
RemoteFile
objects as a
RemoteFileList
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket problem.RemoteFile
,
getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, File outputFile, boolean restartXfer) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, File outputFile, boolean restartXfer) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, OutputStream outputStream) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, OutputStream outputStream) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, File outputFile, boolean restartXfer, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, File outputFile, boolean restartXfer, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, OutputStream outputStream, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, OutputStream outputStream, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, File outputFile, boolean restartXfer, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
download status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, File outputFile, boolean restartXfer, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
download status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, OutputStream outputStream, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.progress
- a Progress
object which is used to
update download status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, OutputStream outputStream, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.progress
- a Progress
object which is used to
update download status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, File outputFile, boolean restartXfer, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
download status.abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, File outputFile, boolean restartXfer, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputFile
- a local file that will act as storage for the
downloaded file. If this parameter is
null
, a local file will be created with
the remote file's name in the current local
directory as specified by user.dir
.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
download status.abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(String remoteFile, OutputStream outputStream, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the name of the remote file that
exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.progress
- a Progress
object which is used to
update download status.abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void retrieve(RemoteFile remoteFile, OutputStream outputStream, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
remoteFile
- the RemoteFile that exists on the FTP server.outputStream
- an output stream that will act as storage for the
downloaded file.progress
- a Progress
object which is used to
update download status.abort
- an Object that allows for the abortion of the
retrieve
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, boolean restartXfer) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.restartXfer
- restart an interrupted transfer (if available).
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, String name, boolean restartXfer) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.name
- the name you want to save the file as.restartXfer
- restart an interrupted transfer (if available).
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream, String name) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.name
- the name you want to save the file as.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, boolean restartXfer, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.restartXfer
- restart an interrupted transfer (if available).abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, String name, boolean restartXfer, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.name
- the name you want to save the file as.restartXfer
- restart an interrupted transfer (if available).abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream, String name, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.name
- the name you want to save the file as.abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, boolean restartXfer, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
upload status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, String name, boolean restartXfer, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.name
- the name you want to save the file as.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
upload status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream, long localFileSize, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.localFileSize
- the size of the "local file".progress
- a Progress
object which is used to
update upload status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream, long localFileSize, String name, Progress progress) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.localFileSize
- the size of the "local file".name
- the name you want to save the file as.progress
- a Progress
object which is used to
update upload status.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, boolean restartXfer, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
upload status.abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(File file, String name, boolean restartXfer, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.name
- the name you want to save the file as.restartXfer
- restart an interrupted transfer (if available).progress
- a Progress
object which is used to update
upload status.abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream, long localFileSize, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.localFileSize
- the size of the "local file".progress
- a Progress
object which is used to
update upload status.abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void store(InputStream inputStream, long localFileSize, String name, Progress progress, FTPAbortableTransfer abort) throws FTPRestartNotSupportedException, FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" input stream you want to upload.localFileSize
- the size of the "local file".name
- the name you want to save the file as.progress
- a Progress
object which is used to
update upload status.abort
- an Object that allows for the abortion of the
store
.
FTPRestartNotSupportedException
- if the FTP server doesn't support
restarting incomplete file xfer.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, String appendTo) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the remote file name you want to append to.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, RemoteFile appendTo) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the RemoteFile
you want to append to.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, String appendTo) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.appendTo
- the remote file name you want to append to.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, RemoteFile appendTo) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.appendTo
- the RemoteFile
you want to append to.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, String appendTo, FTPAbortableTransfer abort) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the remote file name you want to append to.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, RemoteFile appendTo, FTPAbortableTransfer abort) throws FTPException, IOException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the RemoteFile
you want to append to.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, String appendTo, FTPAbortableTransfer abort) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.appendTo
- the remote file name you want to append to.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, RemoteFile appendTo, FTPAbortableTransfer abort) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.appendTo
- the RemoteFile
you want to append to.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, String appendTo, Progress progress) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the remote file name you want to append to.progress
- a Progress
object which is used to update
upload status.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, RemoteFile appendTo, Progress progress) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the RemoteFile
you want to append to.progress
- a Progress
object which is used to update
upload status.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, long localFileSize, String appendTo, Progress progress) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.localFileSize
- the size of the "local file"appendTo
- the remote file name you want to append to.progress
- a Progress
object which is used to
update upload status.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, long localFileSize, RemoteFile appendTo, Progress progress) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.localFileSize
- the size of the "local file"appendTo
- the RemoteFile
you want to append to.progress
- a Progress
object which is used to
update upload status.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, String appendTo, Progress progress, FTPAbortableTransfer abort) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the remote file name you want to append to.progress
- a Progress
object which is used to update
upload status.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(File file, RemoteFile appendTo, Progress progress, FTPAbortableTransfer abort) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
file
- the local file you want to upload.appendTo
- the RemoteFile
you want to append to.progress
- a Progress
object which is used to update
upload status.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, long localFileSize, String appendTo, Progress progress, FTPAbortableTransfer abort) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.localFileSize
- the size of the "local file"appendTo
- the remote file name you want to append to.progress
- a Progress
object which is used to
update upload status.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void append(InputStream inputStream, long localFileSize, RemoteFile appendTo, Progress progress, FTPAbortableTransfer abort) throws FTPException, IOException, IllegalArgumentException
Based on what getConnectionType
returns, either
pasv
or port
will be sent in this routine.
inputStream
- the "local file" stream you want to upload.localFileSize
- the size of the "local file"appendTo
- the RemoteFile
you want to append to.progress
- a Progress
object which is used to
update upload status.abort
- an Object that allows for the abortion of the
append
.
FTPException
- if the FTP server returns an error code.
IOException
- if there is a socket or file problem.
IllegalArgumentException
- if there are argument related problems.getConnectionType()
,
setConnectionType(short)
,
pasv()
,
port(HostInfo)
public void raw(String rawCmd) throws FTPException
rawCmd
- the command sent to the FTP server.
FTPException
- if the FTP server returns an error code.public void noop() throws FTPException
FTPException
- if the FTP server returns an error code.public void abort(FTPAbortableTransfer abort) throws FTPException, IllegalArgumentException
abort
- an Object that will has information that
will allow for the abortion of a transfer.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
abort
argument.public void setStringDataAsUTF8(boolean on) throws FTPException
on
- enable UTF8 support.
FTPException
- if the FTP server returns an error code.public boolean stringDataAsUTF8()
protected HostInfo pasv() throws FTPException
HostInfo object that is used for the data transfer.
- Throws:
FTPException
- if the FTP server returns an error code.
protected void port(HostInfo hostInfo) throws FTPException
hostInfo
- a HostInfo
object that describes the
host information used for the data transfer.
FTPException
- if the FTP server returns an error code.public void chdir(String dir) throws FTPNotADirectoryException, FTPNoSuchFileException, FTPException, IllegalArgumentException
dir
- the name of the remote directory to change to.
FTPNotADirectoryException
- if the dir
arg is not
a directory.
FTPNoSuchFileException
- if the dir
arg could not
be found on the server.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
dir
argument.public void chdir(RemoteFile dir) throws FTPNotADirectoryException, FTPNoSuchFileException, FTPException, IllegalArgumentException
dir
- the remote directory to change to.
FTPNotADirectoryException
- if the dir
arg is not
a directory.
FTPNoSuchFileException
- if the dir
arg could not
be found on the server.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
dir
argument.public String help(String item) throws FTPException
item
- a space-delimited String
of items to get
help on.
FTPException
- if the FTP server returns an error code.public String pwd() throws FTPException
FTPException
- if the FTP server returns an error code.public void ascii() throws FTPException
FTPException
- if the FTP server returns an error code.public void ebcdic() throws FTPException
FTPException
- if the FTP server returns an error code.public void auto()
public void binary() throws FTPException
FTPException
- if the FTP server returns an error code.public void modeZ() throws FTPException
FTPException
- if the FTP server returns an error code.public void delete(String fileName) throws FTPException, IllegalArgumentException
fileName
- the file to delete on the server.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
fileName
argument.public void delete(RemoteFile fileName) throws FTPException, IllegalArgumentException
fileName
- the file to delete on the server.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
fileName
argument.public void rename(String from, String to) throws FTPException, IllegalArgumentException
from
- the old name of the file.to
- the new name of the file.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
from
or to
arguments.public long size(String file) throws FTPNoSuchFileException, FTPException, IllegalArgumentException
file
- the name of the file.
-1
if the size could not be
determined.
FTPNoSuchFileException
- if file
is not found.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if file
is missing.public long size(RemoteFile file) throws FTPNoSuchFileException, FTPException, IllegalArgumentException
file
- the name of the file.
-1
if the size could not be
determined.
FTPNoSuchFileException
- if file
is not found.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if file
is missing.public Date time(String file) throws FTPNoSuchFileException, FTPException, IllegalArgumentException
file
- the name of the file.
null
if the time could not be
determined.
FTPNoSuchFileException
- if file
is not found.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if file
is missing.public Date time(RemoteFile file) throws FTPNoSuchFileException, FTPException, IllegalArgumentException
file
- the name of the file.
null
if the time could not be
determined.
FTPNoSuchFileException
- if file
is not found.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if file
is missing.public void mkdir(String newDir) throws FTPException, FTPAccessDeniedException, IllegalArgumentException
newDir
- the name of the new directory.
FTPAccessDeniedException
- if the directory couldn't be created
due to access restrictions.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
newDir
argument.public void rmdir(String dir) throws FTPException, IllegalArgumentException
dir
- the directory to delete on the server.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
dir
argument.public void rmdir(RemoteFile dir) throws FTPException, IllegalArgumentException
dir
- the directory to delete on the server.
FTPException
- if the FTP server returns an error code.
IllegalArgumentException
- if there is a problem with the
dir
argument.public void cdup() throws FTPException
FTPException
- if the FTP server returns an error code.protected Socket makeControlSocket(HostInfo hostInfo) throws IOException
hostInfo
- a HostInfo
object that
describes where to make the socket.
IOException
- if there is a socket problem.protected Socket makeDataSocket(HostInfo hostInfo) throws IOException
hostInfo
- a HostInfo
object that
describes where to make the socket.
IOException
- if there is a socket problem.protected ServerSocket makeDataServerSocket(HostInfo hostInfo) throws IOException
hostInfo
- a HostInfo
object that
describes where to make the socket.
IOException
- if there is a socket problem.public void setActivePortRange(int minPort, int maxPort) throws Exception
minPort
- the minPort
specifies
the minimum port used for active transfersmaxPort
- the maxPort
specifies
the maximum port used for active transfers
Exception
- if the min/max ports are invalidprotected int getPortFromRange()
public short getTransferMode()
AUTO_TRANSFER_MODE
,
ASCII_TRANSFER_MODE
,
BINARY_TRANSFER_MODE
,
EBCDIC_TRANSFER_MODE
public int getConnectionType()
PASV_CONNECTION_TYPE
,
ACTIVE_CONNECTION_TYPE
public void setConnectionType(short type)
type
- the connection type.PASV_CONNECTION_TYPE
,
ACTIVE_CONNECTION_TYPE
public boolean isConnected()
public boolean isLoggedIn()
public boolean isTransferRestartable()
public String getHostName()
public void setHostName(String hostName)
hostName
- the hostname of the FTP server.public int getPort()
public void setPort(int port)
port
- the port of the FTP server.public String getUser()
public void setUser(String user)
user
- the username.public String getPassword()
public void setPassword(String password)
password
- the password.public String getAccount()
public void setAccount(String account)
account
- the account name.public Socket getControlSocket()
protected void setControlSocket(Socket controlSocket) throws IOException
controlSocket
- the control socket.
IOException
public void setRecvCmdStream(OutputStream recvCmdStream)
recvCmdStream
- the server response stream.
Pass null
to unset this stream.public void setSendCmdStream(OutputStream sendCmdStream)
sendCmdStream
- the commands sent stream.
Pass null
to unset this stream.public short getListStyle()
FTPServerInfo.LIST_STYLE_UNKNOWN
,
FTPServerInfo.LIST_STYLE_UNIX
,
FTPServerInfo.LIST_STYLE_WINDOWS
,
FTPServerInfo.LIST_STYLE_NETWARE
public void setListStyle(short listStyle)
listStyle
- the list style for the server type
(UNIX, NETWARE, Windows, Unknown)FTPServerInfo.LIST_STYLE_UNKNOWN
,
FTPServerInfo.LIST_STYLE_UNIX
,
FTPServerInfo.LIST_STYLE_WINDOWS
,
FTPServerInfo.LIST_STYLE_NETWARE
public void setSocksIVProxy(String host, int port)
host
- the hostname of the proxy.
Pass null
to unset the proxy.port
- the port of the proxy.public void setSocksVProxy(String host, int port, String username, String password)
host
- the hostname of the proxy.
Pass null
to unset the proxy.port
- the port of the proxy.username
- the socks username (can be null for no auth)password
- the socks password (can be null for no auth)public FTPCommand getFTPCommand()
FTPCommand
object.
FTPCommand
object.protected FTPCommand makeFTPCommand(BufferedReader inputReader, PrintWriter outputWriter)
FTPCommand
object.
inputReader
- the BufferedReader
comes from
the input stream of the control socket.outputWriter
- the PrintWriter
comes from
the output stream of the control socket.
FTPCommand
object.public static String getVersion()
public static String getDateStamp()
public void forcePasvToUseControlIP(boolean on)
on
- true if to use control socket IP, false if off.protected void aboutToTransferData()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |