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>
public class CachingSessionFactory.CachedSession extends Object implements Session<F>
-
Method Summary
Modifier and Type Method 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 fromSession.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 rawInputStream
.boolean
remove(String path)
void
rename(String pathFrom, String pathTo)
boolean
rmdir(String directory)
Remove a remote directory.void
write(InputStream inputStream, String destination)
-
Method Details
-
close
public void close() -
remove
- Specified by:
remove
in interfaceSession<F>
- Throws:
IOException
-
list
- Specified by:
list
in interfaceSession<F>
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSession<F>
- Throws:
IOException
-
write
- Specified by:
write
in interfaceSession<F>
- Throws:
IOException
-
append
Description copied from interface:Session
Append to a file.- Specified by:
append
in interfaceSession<F>
- Parameters:
inputStream
- the stream.destination
- the destination.- Throws:
IOException
- an IO Exception.
-
isOpen
public boolean isOpen() -
rename
- Specified by:
rename
in interfaceSession<F>
- Throws:
IOException
-
mkdir
- Specified by:
mkdir
in interfaceSession<F>
- Throws:
IOException
-
rmdir
Description copied from interface:Session
Remove a remote directory.- Specified by:
rmdir
in interfaceSession<F>
- Parameters:
directory
- The directory.- Returns:
- True if the directory was removed.
- Throws:
IOException
- an IO exception.
-
exists
Description copied from interface:Session
Check if the remote file or directory exists.- Specified by:
exists
in interfaceSession<F>
- Parameters:
path
- the remote path.- Returns:
true
orfalse
if remote path exists or not.- Throws:
IOException
- an IO exception during remote interaction.
-
listNames
- Specified by:
listNames
in interfaceSession<F>
- Throws:
IOException
-
readRaw
Description copied from interface:Session
Retrieve a remote file as a rawInputStream
.- Specified by:
readRaw
in interfaceSession<F>
- Parameters:
source
- The path of the remote file.- Returns:
- The raw inputStream.
- Throws:
IOException
- Any IOException.
-
finalizeRaw
Description 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:
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
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
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.
-