Log4j 1.3alpha-3

org.apache.log4j.rolling.helper
Class Util

java.lang.Object
  |
  +--org.apache.log4j.rolling.helper.Util

public class Util
extends java.lang.Object

Utility class to help solving problems encontered while renameing files.

Author:
Ceki Gulcu

Constructor Summary
Util()
           
 
Method Summary
static void rename(java.lang.String from, java.lang.String to)
          A robust file renaming method which in case of failure falls back to renmaing by copying.
static void renameByCopying(java.lang.String from, java.lang.String to)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

rename

public static void rename(java.lang.String from,
                          java.lang.String to)
                   throws RolloverFailure
A robust file renaming method which in case of failure falls back to renmaing by copying. In case, the file to be renamed is open by another process, renaming by copying will succed whereas, regular renaming will fail. However, renaming by copying is much slower.

Parameters:
from -
to -
Throws:
RolloverFailure

renameByCopying

public static void renameByCopying(java.lang.String from,
                                   java.lang.String to)
                            throws RolloverFailure
RolloverFailure

Log4j 1.3alpha-3

Copyright 2000-2003 Apache Software Foundation.