Class FileRenameAction
java.lang.Object
org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
org.apache.logging.log4j.core.appender.rolling.action.FileRenameAction
File rename action.
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
LOGGER
-
Constructor Summary
ConstructorsConstructorDescriptionFileRenameAction
(File src, File dst, boolean renameEmptyFiles) Creates an FileRenameAction. -
Method Summary
Methods inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
close, isComplete, isInterrupted, reportException, run
-
Constructor Details
-
FileRenameAction
Creates an FileRenameAction.- Parameters:
src
- current file name.dst
- new file name.renameEmptyFiles
- if true, rename file even if empty, otherwise delete empty files.
-
-
Method Details
-
execute
public boolean execute()Rename file.- Specified by:
execute
in interfaceAction
- Specified by:
execute
in classAbstractAction
- Returns:
- true if successfully renamed.
-
getDestination
Gets the destination.- Returns:
- the destination.
-
getSource
Gets the source.- Returns:
- the source.
-
isRenameEmptyFiles
public boolean isRenameEmptyFiles()Whether to rename empty files. If true, rename empty files, otherwise delete empty files.- Returns:
- Whether to rename empty files.
-
execute
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.
-
toString
-