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.File
destination
Destination.private boolean
renameEmptyFiles
If true, rename empty files, otherwise delete empty files.private java.io.File
source
Source.
-
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 boolean
execute()
Rename file.static boolean
execute(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:
execute
in interfaceAction
- Specified by:
execute
in 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.
-
-