Class CachingSessionFactory.CachedSession
java.lang.Object
org.springframework.integration.file.remote.session.CachingSessionFactory.CachedSession
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Session<F>
- Enclosing class:
- CachingSessionFactory<F>
public class CachingSessionFactory.CachedSession extends java.lang.Object implements Session<F>
-
Method Summary
Modifier and Type Method Description void
append(java.io.InputStream inputStream, java.lang.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(java.lang.String path)
Check if the remote file or directory exists.boolean
finalizeRaw()
Invoke after closing the InputStream fromSession.readRaw(String)
.java.lang.Object
getClientInstance()
Get the underlying client library's client instance for this session.java.lang.String
getHostPort()
Return the host:port pair this session is connected to.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 os)
java.io.InputStream
readRaw(java.lang.String source)
Retrieve a remote file as a rawInputStream
.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)
-
Method Details
-
close
public void close() -
remove
public boolean remove(java.lang.String path) throws java.io.IOException -
list
-
read
public void read(java.lang.String source, java.io.OutputStream os) throws java.io.IOException -
write
public void write(java.io.InputStream inputStream, java.lang.String destination) throws java.io.IOException -
append
public void append(java.io.InputStream inputStream, java.lang.String destination) throws java.io.IOExceptionDescription copied from interface:Session
Append to a file. -
isOpen
public boolean isOpen() -
rename
public void rename(java.lang.String pathFrom, java.lang.String pathTo) throws java.io.IOException -
mkdir
public boolean mkdir(java.lang.String directory) throws java.io.IOException -
rmdir
public boolean rmdir(java.lang.String directory) throws java.io.IOExceptionDescription copied from interface:Session
Remove a remote directory. -
exists
public boolean exists(java.lang.String path) throws java.io.IOExceptionDescription copied from interface:Session
Check if the remote file or directory exists. -
listNames
public java.lang.String[] listNames(java.lang.String path) throws java.io.IOException -
readRaw
public java.io.InputStream readRaw(java.lang.String source) throws java.io.IOExceptionDescription copied from interface:Session
Retrieve a remote file as a rawInputStream
. -
finalizeRaw
public boolean finalizeRaw() throws java.io.IOExceptionDescription copied from interface:Session
Invoke after closing the InputStream fromSession.readRaw(String)
. Required by some session providers.- Specified by:
finalizeRaw
in interfaceSession<F>
- Returns:
- true if successful.
- Throws:
java.io.IOException
- Any IOException.
-
dirty
public void dirty()Description copied from interface:Session
Mark this session as dirty, indicating that it should not be reused and any delegated sessions should be taken care of before closing. -
getClientInstance
public java.lang.Object getClientInstance()Description copied from interface:Session
Get the underlying client library's client instance for this session. Returns anObject
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.- Specified by:
getClientInstance
in interfaceSession<F>
- Returns:
- The client instance.
-
getHostPort
public java.lang.String getHostPort()Description copied from interface:Session
Return the host:port pair this session is connected to.- Specified by:
getHostPort
in interfaceSession<F>
- Returns:
- the host:port pair this session is connected to.
-