public class RemoteFileTemplate<F> extends Object implements RemoteFileOperations<F>, InitializingBean, BeanFactoryAware
Constructor and Description |
---|
RemoteFileTemplate(SessionFactory<F> sessionFactory) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
<T> T |
execute(SessionCallback<F,T> callback)
Execute the callback's doInSession method after obtaining a session.
|
boolean |
get(Message<?> message,
InputStreamCallback callback)
Retrieve a remote file as an InputStream, based on information in a message.
|
boolean |
get(String remotePath,
InputStreamCallback callback)
Retrieve a remote file as an InputStream.
|
String |
getRemoteFileSeparator() |
String |
getTemporaryFileSuffix() |
boolean |
isUseTemporaryFileName() |
boolean |
remove(String path)
Remove a remote file.
|
void |
rename(String fromPath,
String toPath)
Rename a remote file, creating directories if needed.
|
String |
send(Message<?> message)
Send a file to a remote server, based on information in a message.
|
String |
send(Message<?> message,
String subDirectory)
Send a file to a remote server, based on information in a message.
|
void |
setAutoCreateDirectory(boolean autoCreateDirectory) |
void |
setBeanFactory(BeanFactory beanFactory) |
void |
setCharset(String charset) |
void |
setFileNameExpression(Expression fileNameExpression) |
void |
setFileNameGenerator(FileNameGenerator fileNameGenerator) |
void |
setRemoteDirectoryExpression(Expression remoteDirectoryExpression) |
void |
setRemoteFileSeparator(String remoteFileSeparator) |
void |
setTemporaryFileSuffix(String temporaryFileSuffix) |
void |
setTemporaryRemoteDirectoryExpression(Expression temporaryRemoteDirectoryExpression) |
void |
setUseTemporaryFileName(boolean useTemporaryFileName) |
public RemoteFileTemplate(SessionFactory<F> sessionFactory)
public void setAutoCreateDirectory(boolean autoCreateDirectory)
public void setRemoteFileSeparator(String remoteFileSeparator)
public final String getRemoteFileSeparator()
public void setRemoteDirectoryExpression(Expression remoteDirectoryExpression)
public void setTemporaryRemoteDirectoryExpression(Expression temporaryRemoteDirectoryExpression)
public void setFileNameExpression(Expression fileNameExpression)
public String getTemporaryFileSuffix()
public boolean isUseTemporaryFileName()
public void setUseTemporaryFileName(boolean useTemporaryFileName)
public void setFileNameGenerator(FileNameGenerator fileNameGenerator)
public void setCharset(String charset)
public void setTemporaryFileSuffix(String temporaryFileSuffix)
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public String send(Message<?> message)
RemoteFileOperations
send
in interface RemoteFileOperations<F>
message
- The message.public String send(Message<?> message, String subDirectory)
RemoteFileOperations
send
in interface RemoteFileOperations<F>
message
- The message.subDirectory
- The sub directory.public boolean remove(String path)
RemoteFileOperations
remove
in interface RemoteFileOperations<F>
path
- The full path to the file.public void rename(String fromPath, String toPath)
RemoteFileOperations
rename
in interface RemoteFileOperations<F>
fromPath
- The current path.toPath
- The new path.public boolean get(Message<?> message, InputStreamCallback callback)
RemoteFileOperations
get
in interface RemoteFileOperations<F>
message
- The message which will be evaluated to generate the remote path.callback
- the callback.public boolean get(String remotePath, InputStreamCallback callback)
RemoteFileOperations
get
in interface RemoteFileOperations<F>
remotePath
- The remote path to the file.callback
- the callback.public <T> T execute(SessionCallback<F,T> callback)
RemoteFileOperations
execute
in interface RemoteFileOperations<F>
T
- The type returned by SessionCallback.doInSession(org.springframework.integration.file.remote.session.Session)
.callback
- the SessionCallback.