org.apache.logging.log4j.core.appender.rolling.helper
Class FileRenameAction

java.lang.Object
  extended by org.apache.logging.log4j.core.appender.rolling.helper.ActionBase
      extended by org.apache.logging.log4j.core.appender.rolling.helper.FileRenameAction
All Implemented Interfaces:
Runnable, Action

public final class FileRenameAction
extends ActionBase

File rename action.


Field Summary
 
Fields inherited from class org.apache.logging.log4j.core.appender.rolling.helper.ActionBase
LOGGER
 
Constructor Summary
FileRenameAction(File src, File dst, boolean renameEmptyFiles)
          Creates an FileRenameAction.
 
Method Summary
 boolean execute()
          Rename file.
static boolean execute(File source, File destination, boolean renameEmptyFiles)
          Rename file.
 
Methods inherited from class org.apache.logging.log4j.core.appender.rolling.helper.ActionBase
close, isComplete, reportException, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRenameAction

public FileRenameAction(File src,
                        File dst,
                        boolean renameEmptyFiles)
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 Detail

execute

public boolean execute()
Rename file.

Specified by:
execute in interface Action
Specified by:
execute in class ActionBase
Returns:
true if successfully renamed.

execute

public static boolean execute(File source,
                              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.


Copyright © 1999-2012 Apache Software Foundation. All Rights Reserved.