public class FTPClientWrapper extends java.lang.Object implements FtpClient
I decided to not to use eg. noop() to determine the state of the connection to avoid unnecessary server round-trips.
Modifier and Type | Field and Description |
---|---|
protected FileSystemOptions |
fileSystemOptions |
private org.apache.commons.net.ftp.FTPClient |
ftpClient |
private static org.apache.commons.logging.Log |
LOG |
private GenericFileName |
root |
Modifier | Constructor and Description |
---|---|
protected |
FTPClientWrapper(GenericFileName root,
FileSystemOptions fileSystemOptions) |
Modifier and Type | Method and Description |
---|---|
boolean |
abort() |
java.io.OutputStream |
appendFileStream(java.lang.String relPath) |
boolean |
completePendingCommand() |
private org.apache.commons.net.ftp.FTPClient |
createClient() |
protected org.apache.commons.net.ftp.FTPClient |
createClient(GenericFileName rootName,
UserAuthenticationData authData) |
boolean |
deleteFile(java.lang.String relPath) |
void |
disconnect() |
FileSystemOptions |
getFileSystemOptions() |
private org.apache.commons.net.ftp.FTPClient |
getFtpClient() |
int |
getReplyCode() |
java.lang.String |
getReplyString() |
GenericFileName |
getRoot() |
boolean |
isConnected() |
org.apache.commons.net.ftp.FTPFile[] |
listFiles(java.lang.String relPath) |
private org.apache.commons.net.ftp.FTPFile[] |
listFilesInDirectory(java.lang.String relPath) |
boolean |
makeDirectory(java.lang.String relPath) |
boolean |
removeDirectory(java.lang.String relPath) |
boolean |
rename(java.lang.String oldName,
java.lang.String newName) |
java.io.InputStream |
retrieveFileStream(java.lang.String relPath) |
java.io.InputStream |
retrieveFileStream(java.lang.String relPath,
long restartOffset) |
java.io.OutputStream |
storeFileStream(java.lang.String relPath) |
private static final org.apache.commons.logging.Log LOG
protected final FileSystemOptions fileSystemOptions
private final GenericFileName root
private org.apache.commons.net.ftp.FTPClient ftpClient
protected FTPClientWrapper(GenericFileName root, FileSystemOptions fileSystemOptions) throws FileSystemException
FileSystemException
public GenericFileName getRoot()
public FileSystemOptions getFileSystemOptions()
private org.apache.commons.net.ftp.FTPClient createClient() throws FileSystemException
FileSystemException
protected org.apache.commons.net.ftp.FTPClient createClient(GenericFileName rootName, UserAuthenticationData authData) throws FileSystemException
FileSystemException
private org.apache.commons.net.ftp.FTPClient getFtpClient() throws FileSystemException
FileSystemException
public boolean isConnected() throws FileSystemException
isConnected
in interface FtpClient
FileSystemException
public void disconnect() throws java.io.IOException
disconnect
in interface FtpClient
java.io.IOException
public org.apache.commons.net.ftp.FTPFile[] listFiles(java.lang.String relPath) throws java.io.IOException
private org.apache.commons.net.ftp.FTPFile[] listFilesInDirectory(java.lang.String relPath) throws java.io.IOException
java.io.IOException
public boolean removeDirectory(java.lang.String relPath) throws java.io.IOException
removeDirectory
in interface FtpClient
java.io.IOException
public boolean deleteFile(java.lang.String relPath) throws java.io.IOException
deleteFile
in interface FtpClient
java.io.IOException
public boolean rename(java.lang.String oldName, java.lang.String newName) throws java.io.IOException
public boolean makeDirectory(java.lang.String relPath) throws java.io.IOException
makeDirectory
in interface FtpClient
java.io.IOException
public boolean completePendingCommand() throws java.io.IOException
completePendingCommand
in interface FtpClient
java.io.IOException
public java.io.InputStream retrieveFileStream(java.lang.String relPath) throws java.io.IOException
retrieveFileStream
in interface FtpClient
java.io.IOException
public java.io.InputStream retrieveFileStream(java.lang.String relPath, long restartOffset) throws java.io.IOException
retrieveFileStream
in interface FtpClient
java.io.IOException
public java.io.OutputStream appendFileStream(java.lang.String relPath) throws java.io.IOException
appendFileStream
in interface FtpClient
java.io.IOException
public java.io.OutputStream storeFileStream(java.lang.String relPath) throws java.io.IOException
storeFileStream
in interface FtpClient
java.io.IOException
public boolean abort() throws java.io.IOException
public int getReplyCode() throws java.io.IOException
getReplyCode
in interface FtpClient
java.io.IOException
public java.lang.String getReplyString() throws java.io.IOException
getReplyString
in interface FtpClient
java.io.IOException