Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.logging.log4j.core.appender.rolling.action
Class FileRenameAction

    java.lang.Object
      org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
          org.apache.logging.log4j.core.appender.rolling.action.FileRenameAction

All Implemented Interfaces:
  Runnable, Action

    public class FileRenameAction

extends AbstractAction

File rename action.

Field Summary

Fields inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
`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.
`String` | `toString()`

Methods inherited from class org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
`close, isComplete, reportException, run`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 `AbstractAction`
  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.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.