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 BeanFactoryAwareBeansExceptionpublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanExceptionpublic String send(Message<?> message)
RemoteFileOperationssend in interface RemoteFileOperations<F>message - The message.public String send(Message<?> message, String subDirectory)
RemoteFileOperationssend in interface RemoteFileOperations<F>message - The message.subDirectory - The sub directory.public boolean remove(String path)
RemoteFileOperationsremove in interface RemoteFileOperations<F>path - The full path to the file.public void rename(String fromPath, String toPath)
RemoteFileOperationsrename in interface RemoteFileOperations<F>fromPath - The current path.toPath - The new path.public boolean get(Message<?> message, InputStreamCallback callback)
RemoteFileOperationsget 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)
RemoteFileOperationsget in interface RemoteFileOperations<F>remotePath - The remote path to the file.callback - the callback.public <T> T execute(SessionCallback<F,T> callback)
RemoteFileOperationsexecute in interface RemoteFileOperations<F>T - The type returned by SessionCallback.doInSession(org.springframework.integration.file.remote.session.Session).callback - the SessionCallback.