org.apache.camel.component.file.strategy
Class RenameFileStrategy

java.lang.Object
  extended by org.apache.camel.component.file.strategy.FileStategySupport
      extended by org.apache.camel.component.file.strategy.RenameFileStrategy
All Implemented Interfaces:
FileStrategy

public class RenameFileStrategy
extends FileStategySupport

A strategy to rename a file

Version:
$Revision: 1.1 $

Constructor Summary
RenameFileStrategy()
           
RenameFileStrategy(boolean lock)
           
RenameFileStrategy(boolean lock, String namePrefix, String namePostfix)
           
 
Method Summary
 void commit(FileEndpoint endpoint, FileExchange exchange, File file)
          Releases any file locks and possibly deletes or moves the file
 String getNamePostfix()
           
 String getNamePrefix()
           
 void setNamePostfix(String namePostfix)
          Sets the name postfix appended to moved files.
 void setNamePrefix(String namePrefix)
          Sets the name prefix appended to moved files.
 
Methods inherited from class org.apache.camel.component.file.strategy.FileStategySupport
begin, isLockFile, setLockFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenameFileStrategy

public RenameFileStrategy()

RenameFileStrategy

public RenameFileStrategy(boolean lock)

RenameFileStrategy

public RenameFileStrategy(boolean lock,
                          String namePrefix,
                          String namePostfix)
Method Detail

commit

public void commit(FileEndpoint endpoint,
                   FileExchange exchange,
                   File file)
            throws Exception
Description copied from interface: FileStrategy
Releases any file locks and possibly deletes or moves the file

Specified by:
commit in interface FileStrategy
Overrides:
commit in class FileStategySupport
Throws:
Exception

getNamePostfix

public String getNamePostfix()

setNamePostfix

public void setNamePostfix(String namePostfix)
Sets the name postfix appended to moved files. For example to rename all the files from * to *.done set this value to ".done"


getNamePrefix

public String getNamePrefix()

setNamePrefix

public void setNamePrefix(String namePrefix)
Sets the name prefix appended to moved files. For example to move processed files into a hidden directory called ".camel" set this value to ".camel/"



Copyright © 2007 Apache Software Foundation. All Rights Reserved.