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:
    Runnable, Action

      public final class FileRenameAction
      extends ActionBase

  File rename action.
  Author:
    Curt Arnold

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileRenameAction(File src, File dst, boolean renameEmptyFiles)` Creates an FileRenameAction.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `execute()` Rename file.
    `static boolean` | `execute(File source, File destination, boolean renameEmptyFiles)` Rename file.

    - ### Methods inherited from class org.apache.log4j.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 © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0

Apache Extras for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.