public class FtpSession extends java.lang.Object implements Session<org.apache.commons.net.ftp.FTPFile>
Session
for FTP.Constructor and Description |
---|
FtpSession(org.apache.commons.net.ftp.FTPClient client) |
Modifier and Type | Method and Description |
---|---|
void |
append(java.io.InputStream inputStream,
java.lang.String path)
Append to a file.
|
void |
close() |
boolean |
exists(java.lang.String path)
Check if the remote file or directory exists.
|
boolean |
finalizeRaw()
Invoke after closing the InputStream from
Session.readRaw(String) . |
org.apache.commons.net.ftp.FTPClient |
getClientInstance()
Get the underlying client library's client instance for this session.
|
boolean |
isOpen() |
org.apache.commons.net.ftp.FTPFile[] |
list(java.lang.String path) |
java.lang.String[] |
listNames(java.lang.String path) |
boolean |
mkdir(java.lang.String remoteDirectory) |
void |
read(java.lang.String path,
java.io.OutputStream fos) |
java.io.InputStream |
readRaw(java.lang.String source)
Retrieve a remote file as a raw
InputStream . |
boolean |
remove(java.lang.String path) |
void |
rename(java.lang.String pathFrom,
java.lang.String pathTo) |
boolean |
rmdir(java.lang.String directory)
Remove a remote directory.
|
void |
write(java.io.InputStream inputStream,
java.lang.String path) |
public boolean remove(java.lang.String path) throws java.io.IOException
public org.apache.commons.net.ftp.FTPFile[] list(java.lang.String path) throws java.io.IOException
public java.lang.String[] listNames(java.lang.String path) throws java.io.IOException
public void read(java.lang.String path, java.io.OutputStream fos) throws java.io.IOException
public java.io.InputStream readRaw(java.lang.String source) throws java.io.IOException
Session
InputStream
.public boolean finalizeRaw() throws java.io.IOException
Session
Session.readRaw(String)
.
Required by some session providers.finalizeRaw
in interface Session<org.apache.commons.net.ftp.FTPFile>
java.io.IOException
- Any IOException.public void write(java.io.InputStream inputStream, java.lang.String path) throws java.io.IOException
public void append(java.io.InputStream inputStream, java.lang.String path) throws java.io.IOException
Session
public void close()
public boolean isOpen()
public void rename(java.lang.String pathFrom, java.lang.String pathTo) throws java.io.IOException
public boolean mkdir(java.lang.String remoteDirectory) throws java.io.IOException
public boolean rmdir(java.lang.String directory) throws java.io.IOException
Session
public boolean exists(java.lang.String path) throws java.io.IOException
Session
public org.apache.commons.net.ftp.FTPClient getClientInstance()
Session
Object
to avoid significant changes to -file, -ftp, -sftp
modules, which would be required
if we added another generic parameter. Implementations should narrow the
return type.getClientInstance
in interface Session<org.apache.commons.net.ftp.FTPFile>