public class CachingSessionFactory.CachedSession extends Object implements Session<F>
Modifier and Type | Method and Description |
---|---|
void |
append(InputStream inputStream,
String destination)
Append to a file.
|
void |
close() |
void |
dirty()
Mark this session as dirty, indicating that it should not be reused and any
delegated sessions should be taken care of before closing.
|
boolean |
exists(String path)
Check if the remote file or directory exists.
|
boolean |
finalizeRaw()
Invoke after closing the InputStream from
Session.readRaw(String) . |
Object |
getClientInstance()
Get the underlying client library's client instance for this session.
|
String |
getHostPort()
Return the host:port pair this session is connected to.
|
boolean |
isOpen() |
F[] |
list(String path) |
String[] |
listNames(String path) |
boolean |
mkdir(String directory) |
void |
read(String source,
OutputStream os) |
InputStream |
readRaw(String source)
Retrieve a remote file as a raw
InputStream . |
boolean |
remove(String path) |
void |
rename(String pathFrom,
String pathTo) |
boolean |
rmdir(String directory)
Remove a remote directory.
|
void |
write(InputStream inputStream,
String destination) |
public void close()
public boolean remove(String path) throws IOException
remove
in interface Session<F>
IOException
public F[] list(String path) throws IOException
list
in interface Session<F>
IOException
public void read(String source, OutputStream os) throws IOException
read
in interface Session<F>
IOException
public void write(InputStream inputStream, String destination) throws IOException
write
in interface Session<F>
IOException
public void append(InputStream inputStream, String destination) throws IOException
Session
append
in interface Session<F>
inputStream
- the stream.destination
- the destination.IOException
- an IO Exception.public void rename(String pathFrom, String pathTo) throws IOException
rename
in interface Session<F>
IOException
public boolean mkdir(String directory) throws IOException
mkdir
in interface Session<F>
IOException
public boolean rmdir(String directory) throws IOException
Session
rmdir
in interface Session<F>
directory
- The directory.IOException
- an IO exception.public boolean exists(String path) throws IOException
Session
exists
in interface Session<F>
path
- the remote path.true
or false
if remote path exists or not.IOException
- an IO exception during remote interaction.public String[] listNames(String path) throws IOException
listNames
in interface Session<F>
IOException
public InputStream readRaw(String source) throws IOException
Session
InputStream
.readRaw
in interface Session<F>
source
- The path of the remote file.IOException
- Any IOException.public boolean finalizeRaw() throws IOException
Session
Session.readRaw(String)
.
Required by some session providers.finalizeRaw
in interface Session<F>
IOException
- Any IOException.public void dirty()
Session
public Object 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<F>
public String getHostPort()
Session
getHostPort
in interface Session<F>