Package org.apache.log4j.rolling.helper
Class FileRenameAction
- java.lang.Object
-
- org.apache.log4j.rolling.helper.ActionBase
-
- org.apache.log4j.rolling.helper.FileRenameAction
-
- All Implemented Interfaces:
java.lang.Runnable,Action
public final class FileRenameAction extends ActionBase
File rename action.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FiledestinationDestination.private booleanrenameEmptyFilesIf true, rename empty files, otherwise delete empty files.private java.io.FilesourceSource.
-
Constructor Summary
Constructors Constructor Description FileRenameAction(java.io.File src, java.io.File dst, boolean renameEmptyFiles)Creates an FileRenameAction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexecute()Rename file.static booleanexecute(java.io.File source, java.io.File destination, boolean renameEmptyFiles)Rename file.-
Methods inherited from class org.apache.log4j.rolling.helper.ActionBase
close, isComplete, reportException, run
-
-
-
-
Method Detail
-
execute
public boolean execute()
Rename file.- Specified by:
executein interfaceAction- Specified by:
executein classActionBase- Returns:
- true if successfully renamed.
-
execute
public static boolean execute(java.io.File source, java.io.File destination, boolean renameEmptyFiles)Rename file.- Parameters:
source- current file name.destination- new file name.renameEmptyFiles- if true, rename file even if empty, otherwise delete empty files.- Returns:
- true if successfully renamed.
-
-