public interface FtpClient
| Modifier and Type | Method and Description |
|---|---|
boolean |
abort() |
OutputStream |
appendFileStream(String relPath) |
boolean |
completePendingCommand() |
boolean |
deleteFile(String relPath) |
void |
disconnect() |
default int |
getReplyCode() |
String |
getReplyString() |
boolean |
hasFeature(String feature)
Queries the server for a supported feature.
|
boolean |
isConnected() |
org.apache.commons.net.ftp.FTPFile[] |
listFiles(String relPath) |
boolean |
makeDirectory(String relPath) |
default Instant |
mdtmInstant(String relPath)
Sends the MDTM command to get a file's date and time information after file transfer.
|
boolean |
removeDirectory(String relPath) |
boolean |
rename(String oldName,
String newName) |
InputStream |
retrieveFileStream(String relPath) |
default InputStream |
retrieveFileStream(String relPath,
int bufferSize) |
InputStream |
retrieveFileStream(String relPath,
long restartOffset) |
default void |
setBufferSize(int bufferSize) |
OutputStream |
storeFileStream(String relPath) |
boolean abort()
throws IOException
IOExceptionOutputStream appendFileStream(String relPath) throws IOException
IOExceptionboolean completePendingCommand()
throws IOException
IOExceptionboolean deleteFile(String relPath) throws IOException
IOExceptionvoid disconnect()
throws IOException
IOExceptiondefault int getReplyCode()
throws IOException
IOExceptionString getReplyString() throws IOException
IOExceptionboolean hasFeature(String feature) throws IOException
feature - the name of the feature, converted to upper case.true if the feature is present, false if the feature is not present or the FTP command
failed.IOException - on errorboolean isConnected()
throws FileSystemException
FileSystemExceptionorg.apache.commons.net.ftp.FTPFile[] listFiles(String relPath) throws IOException
IOExceptionboolean makeDirectory(String relPath) throws IOException
IOExceptiondefault Instant mdtmInstant(String relPath) throws IOException
"LIST" command response. Time values are always represented in UTC (GMT), and in the
Gregorian calendar regardless of what calendar may have been in use at the date and time the file was last
modified.
NOTE: not all remote FTP servers support MDTM.
relPath - The relative path of the file object to execute MDTM command againstInstant object containing the MDTM timestamp.IOException - If the underlying FTP client encountered an error.boolean removeDirectory(String relPath) throws IOException
IOExceptionboolean rename(String oldName, String newName) throws IOException
IOExceptionInputStream retrieveFileStream(String relPath) throws IOException
IOExceptiondefault InputStream retrieveFileStream(String relPath, int bufferSize) throws IOException
IOExceptionInputStream retrieveFileStream(String relPath, long restartOffset) throws IOException
IOExceptiondefault void setBufferSize(int bufferSize)
throws FileSystemException
FileSystemExceptionOutputStream storeFileStream(String relPath) throws IOException
IOExceptionCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.