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 voidappend(java.io.InputStream inputStream, java.lang.String destination)Append to a file.voidclose()voiddirty()Mark this session as dirty, indicating that it should not be reused and any delegated sessions should be taken care of before closing.booleanexists(java.lang.String path)Check if the remote file or directory exists.booleanfinalizeRaw()Invoke after closing the InputStream fromSession.readRaw(String).java.lang.ObjectgetClientInstance()Get the underlying client library's client instance for this session.java.lang.StringgetHostPort()Return the host:port pair this session is connected to.booleanisOpen()F[]list(java.lang.String path)java.lang.String[]listNames(java.lang.String path)booleanmkdir(java.lang.String directory)voidread(java.lang.String source, java.io.OutputStream os)java.io.InputStreamreadRaw(java.lang.String source)Retrieve a remote file as a rawInputStream.booleanremove(java.lang.String path)voidrename(java.lang.String pathFrom, java.lang.String pathTo)booleanrmdir(java.lang.String directory)Remove a remote directory.voidwrite(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:SessionAppend 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:SessionRemove a remote directory. -
exists
public boolean exists(java.lang.String path) throws java.io.IOExceptionDescription copied from interface:SessionCheck 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:SessionRetrieve a remote file as a rawInputStream. -
finalizeRaw
public boolean finalizeRaw() throws java.io.IOExceptionDescription copied from interface:SessionInvoke after closing the InputStream fromSession.readRaw(String). Required by some session providers.- Specified by:
finalizeRawin interfaceSession<F>- Returns:
- true if successful.
- Throws:
java.io.IOException- Any IOException.
-
dirty
public void dirty()Description copied from interface:SessionMark 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:SessionGet the underlying client library's client instance for this session. Returns anObjectto 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:
getClientInstancein interfaceSession<F>- Returns:
- The client instance.
-
getHostPort
public java.lang.String getHostPort()Description copied from interface:SessionReturn the host:port pair this session is connected to.- Specified by:
getHostPortin interfaceSession<F>- Returns:
- the host:port pair this session is connected to.
-