public interface Session<F>
extends java.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
append(java.io.InputStream inputStream,
java.lang.String destination)
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
readRaw(String). |
java.lang.Object |
getClientInstance()
Get the underlying client library's client instance for this session.
|
boolean |
isOpen() |
F[] |
list(java.lang.String path) |
java.lang.String[] |
listNames(java.lang.String path) |
boolean |
mkdir(java.lang.String directory) |
void |
read(java.lang.String source,
java.io.OutputStream outputStream) |
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 destination) |
boolean remove(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionF[] list(java.lang.String path) throws java.io.IOException
java.io.IOExceptionvoid read(java.lang.String source,
java.io.OutputStream outputStream)
throws java.io.IOException
java.io.IOExceptionvoid write(java.io.InputStream inputStream,
java.lang.String destination)
throws java.io.IOException
java.io.IOExceptionvoid append(java.io.InputStream inputStream,
java.lang.String destination)
throws java.io.IOException
inputStream - the stream.destination - the destination.java.io.IOException - an IO Exception.boolean mkdir(java.lang.String directory)
throws java.io.IOException
java.io.IOExceptionboolean rmdir(java.lang.String directory)
throws java.io.IOException
directory - The directory.java.io.IOException - an IO exception.void rename(java.lang.String pathFrom,
java.lang.String pathTo)
throws java.io.IOException
java.io.IOExceptionvoid close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableboolean isOpen()
boolean exists(java.lang.String path)
throws java.io.IOException
path - the remote path.true or false if remote path exists or not.java.io.IOException - an IO exception during remote interaction.java.lang.String[] listNames(java.lang.String path)
throws java.io.IOException
java.io.IOExceptionjava.io.InputStream readRaw(java.lang.String source)
throws java.io.IOException
InputStream.source - The path of the remote file.java.io.IOException - Any IOException.boolean finalizeRaw()
throws java.io.IOException
readRaw(String).
Required by some session providers.java.io.IOException - Any IOException.java.lang.Object getClientInstance()
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.