Class CachingSessionFactory.CachedSession
java.lang.Object
org.springframework.integration.file.remote.session.CachingSessionFactory.CachedSession
- All Implemented Interfaces:
Closeable,AutoCloseable,Session<F>
- Enclosing class:
- CachingSessionFactory<F>
-
Method Summary
Modifier and TypeMethodDescriptionvoidappend(InputStream inputStream, 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.booleanCheck if the remote file or directory exists.booleanInvoke after closing the InputStream fromSession.readRaw(String).Get the underlying client library's client instance for this session.Return the host:port pair this session is connected to.booleanisOpen()F[]String[]booleanvoidread(String source, OutputStream os) Retrieve a remote file as a rawInputStream.booleanvoidbooleanRemove a remote directory.voidwrite(InputStream inputStream, String destination)
-
Method Details
-
close
public void close() -
remove
- Specified by:
removein interfaceSession<F>- Throws:
IOException
-
list
- Specified by:
listin interfaceSession<F>- Throws:
IOException
-
read
- Specified by:
readin interfaceSession<F>- Throws:
IOException
-
write
- Specified by:
writein interfaceSession<F>- Throws:
IOException
-
append
Description copied from interface:SessionAppend to a file.- Specified by:
appendin interfaceSession<F>- Parameters:
inputStream- the stream.destination- the destination.- Throws:
IOException- an IO Exception.
-
isOpen
public boolean isOpen() -
rename
- Specified by:
renamein interfaceSession<F>- Throws:
IOException
-
mkdir
- Specified by:
mkdirin interfaceSession<F>- Throws:
IOException
-
rmdir
Description copied from interface:SessionRemove a remote directory.- Specified by:
rmdirin interfaceSession<F>- Parameters:
directory- The directory.- Returns:
- True if the directory was removed.
- Throws:
IOException- an IO exception.
-
exists
Description copied from interface:SessionCheck if the remote file or directory exists.- Specified by:
existsin interfaceSession<F>- Parameters:
path- the remote path.- Returns:
trueorfalseif remote path exists or not.- Throws:
IOException- an IO exception during remote interaction.
-
listNames
- Specified by:
listNamesin interfaceSession<F>- Throws:
IOException
-
readRaw
Description copied from interface:SessionRetrieve a remote file as a rawInputStream.- Specified by:
readRawin interfaceSession<F>- Parameters:
source- The path of the remote file.- Returns:
- The raw inputStream.
- Throws:
IOException- Any IOException.
-
finalizeRaw
Description 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:
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
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
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.
-