ch.qos.logback.core.rolling.helper
Class RenameUtil

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.rolling.helper.RenameUtil
All Implemented Interfaces:
ContextAware

public class RenameUtil
extends ContextAwareBase

Utility class to help solving problems encountered while renaming files.

Author:
Ceki Gulcu

Field Summary
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
RenameUtil()
           
 
Method Summary
 void rename(String from, String to)
          A robust file renaming method which in case of failure falls back to renaming by copying.
 void renameByCopying(String from, String to)
           
 String toString()
           
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenameUtil

public RenameUtil()
Method Detail

rename

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

Parameters:
from -
to -
Throws:
RolloverFailure

renameByCopying

public void renameByCopying(String from,
                            String to)
                     throws RolloverFailure
Throws:
RolloverFailure

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2013 QOS.ch. All Rights Reserved.