org.apache.camel.component.file.strategy
Class RenameFileProcessStrategy
java.lang.Object
org.apache.camel.component.file.strategy.FileProcessStrategySupport
org.apache.camel.component.file.strategy.RenameFileProcessStrategy
- All Implemented Interfaces:
- FileProcessStrategy
public class RenameFileProcessStrategy
- extends FileProcessStrategySupport
A strategy to rename a file
- Version:
- $Revision: 1925 $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RenameFileProcessStrategy
public RenameFileProcessStrategy()
RenameFileProcessStrategy
public RenameFileProcessStrategy(boolean lock)
RenameFileProcessStrategy
public RenameFileProcessStrategy(boolean lock,
String namePrefix,
String namePostfix)
RenameFileProcessStrategy
public RenameFileProcessStrategy(boolean lock,
String namePrefix,
String namePostfix,
String preNamePrefix,
String preNamePostfix)
RenameFileProcessStrategy
public RenameFileProcessStrategy(boolean lock,
FileRenamer commitRenamer,
FileRenamer beginRenamer)
begin
public boolean begin(FileEndpoint endpoint,
FileExchange exchange,
File file)
throws Exception
- Description copied from interface:
FileProcessStrategy
- Called when work is about to begin on this file. This method may attempt to acquire some file lock before
returning true; returning false if the file lock could not be obtained so that the file should be ignored.
- Specified by:
begin
in interface FileProcessStrategy
- Overrides:
begin
in class FileProcessStrategySupport
- Parameters:
endpoint
- the endpointexchange
- the exchangefile
- the file
- Returns:
- true if the file can be processed (such as if a file lock could be obtained)
- Throws:
Exception
- can be thrown in case of errors
commit
public void commit(FileEndpoint endpoint,
FileExchange exchange,
File file)
throws Exception
- Description copied from interface:
FileProcessStrategy
- Releases any file locks and possibly deletes or moves the file after successful processing
- Specified by:
commit
in interface FileProcessStrategy
- Overrides:
commit
in class FileProcessStrategySupport
- Parameters:
endpoint
- the endpointexchange
- the exchangefile
- the file
- Throws:
Exception
- can be thrown in case of errors
getBeginRenamer
public FileRenamer getBeginRenamer()
setBeginRenamer
public void setBeginRenamer(FileRenamer beginRenamer)
getCommitRenamer
public FileRenamer getCommitRenamer()
setCommitRenamer
public void setCommitRenamer(FileRenamer commitRenamer)
Copyright © 2009 IONA Open Source Community. All Rights Reserved.