Class SmbRemoteFileTemplate
java.lang.Object
org.springframework.integration.file.remote.RemoteFileTemplate<jcifs.smb.SmbFile>
org.springframework.integration.smb.session.SmbRemoteFileTemplate
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,InitializingBean
,RemoteFileOperations<jcifs.smb.SmbFile>
The SMB-specific
RemoteFileTemplate
implementation.- Since:
- 6.0
- Author:
- Artem Bilan
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.file.remote.RemoteFileOperations
RemoteFileOperations.OperationsCallback<F,
T> -
Field Summary
Fields inherited from class org.springframework.integration.file.remote.RemoteFileTemplate
logger, sessionFactory
-
Constructor Summary
ConstructorDescriptionSmbRemoteFileTemplate
(SessionFactory<jcifs.smb.SmbFile> sessionFactory) Construct aSmbRemoteFileTemplate
with the supplied session factory. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isStatusDirty
(int status) Check ifSmbException.getNtStatus()
is treated as fatal.protected boolean
Determine whetherSession.dirty()
should be called in theRemoteFileTemplate.execute(SessionCallback)
when an exception is thrown from the callback.Methods inherited from class org.springframework.integration.file.remote.RemoteFileTemplate
afterPropertiesSet, append, append, execute, executeWithClient, exists, get, get, getDirectoryExpressionProcessor, getRemoteFileSeparator, getSession, getSessionFactory, getTemporaryFileSuffix, invoke, isUseTemporaryFileName, list, remove, rename, send, send, setAutoCreateDirectory, setBeanFactory, setCharset, setFileNameExpression, setFileNameGenerator, setRemoteDirectoryExpression, setRemoteFileSeparator, setTemporaryFileSuffix, setTemporaryRemoteDirectoryExpression, setUseTemporaryFileName
-
Field Details
-
NOT_DIRTY_STATUSES
-
-
Constructor Details
-
SmbRemoteFileTemplate
Construct aSmbRemoteFileTemplate
with the supplied session factory.- Parameters:
sessionFactory
- the session factory.
-
-
Method Details
-
shouldMarkSessionAsDirty
Description copied from class:RemoteFileTemplate
Determine whetherSession.dirty()
should be called in theRemoteFileTemplate.execute(SessionCallback)
when an exception is thrown from the callback. By default, this method returnstrue
. Remote file protocol extensions can override this method to provide a specific strategy against the thrown exception, e.g.file not found
error is not a signal that session is broken.- Overrides:
shouldMarkSessionAsDirty
in classRemoteFileTemplate<jcifs.smb.SmbFile>
- Parameters:
ex
- the exception to check ifSession
must be marked as dirty.- Returns:
- true if
Session.dirty()
should be called.
-
isStatusDirty
protected boolean isStatusDirty(int status) Check ifSmbException.getNtStatus()
is treated as fatal.- Parameters:
status
- the value fromSmbException.getNtStatus()
.- Returns:
- true if
SmbException.getNtStatus()
is treated as fatal. - Since:
- 6.0.8
-