Interface FtpClient
-
- All Known Implementing Classes:
FTPClientWrapper
public interface FtpClient
What VFS expects from an FTP client to provide.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
abort()
java.io.OutputStream
appendFileStream(java.lang.String relPath)
boolean
completePendingCommand()
boolean
deleteFile(java.lang.String relPath)
void
disconnect()
default int
getReplyCode()
java.lang.String
getReplyString()
boolean
hasFeature(java.lang.String feature)
Queries the server for a supported feature.boolean
isConnected()
org.apache.commons.net.ftp.FTPFile[]
listFiles(java.lang.String relPath)
boolean
makeDirectory(java.lang.String relPath)
default java.time.Instant
mdtmInstant(java.lang.String relPath)
Sends the MDTM command to get a file's date and time information after file transfer.boolean
removeDirectory(java.lang.String relPath)
boolean
rename(java.lang.String oldName, java.lang.String newName)
java.io.InputStream
retrieveFileStream(java.lang.String relPath)
default java.io.InputStream
retrieveFileStream(java.lang.String relPath, int bufferSize)
java.io.InputStream
retrieveFileStream(java.lang.String relPath, long restartOffset)
default void
setBufferSize(int bufferSize)
java.io.OutputStream
storeFileStream(java.lang.String relPath)
-
-
-
Method Detail
-
abort
boolean abort() throws java.io.IOException
- Throws:
java.io.IOException
-
appendFileStream
java.io.OutputStream appendFileStream(java.lang.String relPath) throws java.io.IOException
- Throws:
java.io.IOException
-
completePendingCommand
boolean completePendingCommand() throws java.io.IOException
- Throws:
java.io.IOException
-
deleteFile
boolean deleteFile(java.lang.String relPath) throws java.io.IOException
- Throws:
java.io.IOException
-
disconnect
void disconnect() throws java.io.IOException
- Throws:
java.io.IOException
-
getReplyCode
default int getReplyCode() throws java.io.IOException
- Throws:
java.io.IOException
-
getReplyString
java.lang.String getReplyString() throws java.io.IOException
- Throws:
java.io.IOException
-
hasFeature
boolean hasFeature(java.lang.String feature) throws java.io.IOException
Queries the server for a supported feature.- Parameters:
feature
- the name of the feature, converted to upper case.- Returns:
true
if the feature is present,false
if the feature is not present or the FTP command failed.- Throws:
java.io.IOException
- on error- Since:
- 2.8.0
-
isConnected
boolean isConnected() throws FileSystemException
- Throws:
FileSystemException
-
listFiles
org.apache.commons.net.ftp.FTPFile[] listFiles(java.lang.String relPath) throws java.io.IOException
- Throws:
java.io.IOException
-
makeDirectory
boolean makeDirectory(java.lang.String relPath) throws java.io.IOException
- Throws:
java.io.IOException
-
mdtmInstant
default java.time.Instant mdtmInstant(java.lang.String relPath) throws java.io.IOException
Sends the MDTM command to get a file's date and time information after file transfer. It is typically more accurate than the"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
.- Parameters:
relPath
- The relative path of the file object to executeMDTM
command against- Returns:
- new
Instant
object containing theMDTM
timestamp. - Throws:
java.io.IOException
- If the underlying FTP client encountered an error.- Since:
- 2.8.0
-
removeDirectory
boolean removeDirectory(java.lang.String relPath) throws java.io.IOException
- Throws:
java.io.IOException
-
rename
boolean rename(java.lang.String oldName, java.lang.String newName) throws java.io.IOException
- Throws:
java.io.IOException
-
retrieveFileStream
java.io.InputStream retrieveFileStream(java.lang.String relPath) throws java.io.IOException
- Throws:
java.io.IOException
-
retrieveFileStream
default java.io.InputStream retrieveFileStream(java.lang.String relPath, int bufferSize) throws java.io.IOException
- Throws:
java.io.IOException
-
retrieveFileStream
java.io.InputStream retrieveFileStream(java.lang.String relPath, long restartOffset) throws java.io.IOException
- Throws:
java.io.IOException
-
setBufferSize
default void setBufferSize(int bufferSize) throws FileSystemException
- Throws:
FileSystemException
-
storeFileStream
java.io.OutputStream storeFileStream(java.lang.String relPath) throws java.io.IOException
- Throws:
java.io.IOException
-
-