org.springframework.integration.adapter.file
Class FileSource
java.lang.Object
org.springframework.integration.adapter.file.AbstractDirectorySource
org.springframework.integration.adapter.file.FileSource
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, MessageDeliveryAware, MessageSource<java.lang.Object>
public class FileSource
- extends AbstractDirectorySource
- implements MessageSource<java.lang.Object>, org.springframework.beans.factory.InitializingBean, MessageDeliveryAware
A messaging source that polls a directory to retrieve files.
- Author:
- Mark Fisher, Marius Bogoevici
Constructor Summary |
FileSource(org.springframework.core.io.Resource directory)
|
FileSource(org.springframework.core.io.Resource directory,
MessageCreator<java.io.File,?> messageCreator)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
directory
private final java.io.File directory
messageCreator
private volatile MessageCreator<java.io.File,?> messageCreator
fileFilter
private volatile java.io.FileFilter fileFilter
filenameFilter
private volatile java.io.FilenameFilter filenameFilter
FileSource
public FileSource(org.springframework.core.io.Resource directory)
FileSource
public FileSource(org.springframework.core.io.Resource directory,
MessageCreator<java.io.File,?> messageCreator)
setMessageCreator
public void setMessageCreator(MessageCreator<java.io.File,?> messageCreator)
setFileFilter
public void setFileFilter(java.io.FileFilter fileFilter)
setFilenameFilter
public void setFilenameFilter(java.io.FilenameFilter filenameFilter)
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
disconnect
protected void disconnect()
- Description copied from class:
AbstractDirectorySource
- Disconnects from the directory
- Specified by:
disconnect
in class AbstractDirectorySource
establishConnection
protected void establishConnection()
throws java.io.IOException
- Description copied from class:
AbstractDirectorySource
- Connects to the directory, if necessary.
- Specified by:
establishConnection
in class AbstractDirectorySource
- Throws:
java.io.IOException
populateSnapshot
protected void populateSnapshot(java.util.Map<java.lang.String,FileInfo> snapshot)
throws java.io.IOException
- Description copied from class:
AbstractDirectorySource
- Constructs the snapshot by iterating files.
- Specified by:
populateSnapshot
in class AbstractDirectorySource
- Throws:
java.io.IOException
retrieveNextFile
protected java.io.File retrieveNextFile()
throws java.io.IOException
- Description copied from class:
AbstractDirectorySource
- Returns the next file, based on the backlog data.
- Specified by:
retrieveNextFile
in class AbstractDirectorySource
- Returns:
-
- Throws:
java.io.IOException