Log4j 1.3alpha-5

org.apache.log4j.rolling.helper
Class Util

java.lang.Object
  |
  +--org.apache.log4j.spi.ComponentBase
        |
        +--org.apache.log4j.rolling.helper.Util
All Implemented Interfaces:
Component

public class Util
extends ComponentBase

Utility class to help solving problems encontered while renameing files.

Author:
Ceki Gulcu

Field Summary
 
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
 
Constructor Summary
Util()
           
 
Method Summary
 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.
 void renameByCopying(java.lang.String from, java.lang.String to)
           
 
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, setLoggerRepository
 
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 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 void renameByCopying(java.lang.String from,
                            java.lang.String to)
                     throws RolloverFailure
RolloverFailure

Log4j 1.3alpha-5

Copyright 2000-2005 Apache Software Foundation.