public class RemoteFileTemplate<F> extends java.lang.Object implements RemoteFileOperations<F>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.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(org.springframework.messaging.Message<?> message,
InputStreamCallback callback)
Retrieve a remote file as an InputStream, based on information in a message.
|
java.lang.String |
getRemoteFileSeparator() |
java.lang.String |
getTemporaryFileSuffix() |
boolean |
isUseTemporaryFileName() |
boolean |
remove(java.lang.String path)
Remove a remote file.
|
void |
rename(java.lang.String fromPath,
java.lang.String toPath)
Rename a remote file, creating directories if needed.
|
java.lang.String |
send(org.springframework.messaging.Message<?> message)
Send a file to a remote server, based on information in a message.
|
java.lang.String |
send(org.springframework.messaging.Message<?> message,
java.lang.String subDirectory)
Send a file to a remote server, based on information in a message.
|
void |
setAutoCreateDirectory(boolean autoCreateDirectory) |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setCharset(java.lang.String charset) |
void |
setFileNameExpression(org.springframework.expression.Expression fileNameExpression) |
void |
setFileNameGenerator(FileNameGenerator fileNameGenerator) |
void |
setRemoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression) |
void |
setRemoteFileSeparator(java.lang.String remoteFileSeparator) |
void |
setTemporaryFileSuffix(java.lang.String temporaryFileSuffix) |
void |
setTemporaryRemoteDirectoryExpression(org.springframework.expression.Expression temporaryRemoteDirectoryExpression) |
void |
setUseTemporaryFileName(boolean useTemporaryFileName) |
public RemoteFileTemplate(SessionFactory<F> sessionFactory)
public void setAutoCreateDirectory(boolean autoCreateDirectory)
public void setRemoteFileSeparator(java.lang.String remoteFileSeparator)
public final java.lang.String getRemoteFileSeparator()
public void setRemoteDirectoryExpression(org.springframework.expression.Expression remoteDirectoryExpression)
public void setTemporaryRemoteDirectoryExpression(org.springframework.expression.Expression temporaryRemoteDirectoryExpression)
public void setFileNameExpression(org.springframework.expression.Expression fileNameExpression)
public java.lang.String getTemporaryFileSuffix()
public boolean isUseTemporaryFileName()
public void setUseTemporaryFileName(boolean useTemporaryFileName)
public void setFileNameGenerator(FileNameGenerator fileNameGenerator)
public void setCharset(java.lang.String charset)
public void setTemporaryFileSuffix(java.lang.String temporaryFileSuffix)
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
throws org.springframework.beans.BeansException
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwareorg.springframework.beans.BeansExceptionpublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exceptionpublic java.lang.String send(org.springframework.messaging.Message<?> message)
RemoteFileOperationssend in interface RemoteFileOperations<F>message - The message.public java.lang.String send(org.springframework.messaging.Message<?> message,
java.lang.String subDirectory)
RemoteFileOperationssend in interface RemoteFileOperations<F>message - The message.subDirectory - The sub directory.public boolean remove(java.lang.String path)
RemoteFileOperationsremove in interface RemoteFileOperations<F>path - The full path to the file.public void rename(java.lang.String fromPath,
java.lang.String toPath)
RemoteFileOperationsrename in interface RemoteFileOperations<F>fromPath - The current path.toPath - The new path.public boolean get(org.springframework.messaging.Message<?> message,
InputStreamCallback callback)
RemoteFileOperationsget in interface RemoteFileOperations<F>callback - the callback.public <T> T execute(SessionCallback<F,T> callback)
RemoteFileOperationsexecute in interface RemoteFileOperations<F>callback - the SessionCallback.