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
FileSystemExceptionpublic GenericFileName getRoot()
public FileSystemOptions getFileSystemOptions()
private org.apache.commons.net.ftp.FTPClient createClient()
throws FileSystemException
FileSystemExceptionprotected org.apache.commons.net.ftp.FTPClient createClient(GenericFileName rootName, UserAuthenticationData authData) throws FileSystemException
FileSystemExceptionprivate org.apache.commons.net.ftp.FTPClient getFtpClient()
throws FileSystemException
FileSystemExceptionpublic boolean isConnected()
throws FileSystemException
isConnected in interface FtpClientFileSystemExceptionpublic void disconnect()
throws java.io.IOException
disconnect in interface FtpClientjava.io.IOExceptionpublic 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.IOExceptionpublic boolean removeDirectory(java.lang.String relPath)
throws java.io.IOException
removeDirectory in interface FtpClientjava.io.IOExceptionpublic boolean deleteFile(java.lang.String relPath)
throws java.io.IOException
deleteFile in interface FtpClientjava.io.IOExceptionpublic 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 FtpClientjava.io.IOExceptionpublic boolean completePendingCommand()
throws java.io.IOException
completePendingCommand in interface FtpClientjava.io.IOExceptionpublic java.io.InputStream retrieveFileStream(java.lang.String relPath)
throws java.io.IOException
retrieveFileStream in interface FtpClientjava.io.IOExceptionpublic java.io.InputStream retrieveFileStream(java.lang.String relPath,
long restartOffset)
throws java.io.IOException
retrieveFileStream in interface FtpClientjava.io.IOExceptionpublic java.io.OutputStream appendFileStream(java.lang.String relPath)
throws java.io.IOException
appendFileStream in interface FtpClientjava.io.IOExceptionpublic java.io.OutputStream storeFileStream(java.lang.String relPath)
throws java.io.IOException
storeFileStream in interface FtpClientjava.io.IOExceptionpublic boolean abort()
throws java.io.IOException
public int getReplyCode()
throws java.io.IOException
getReplyCode in interface FtpClientjava.io.IOExceptionpublic java.lang.String getReplyString()
throws java.io.IOException
getReplyString in interface FtpClientjava.io.IOException