Top Description Fields Constructors Methods
ch.qos.logback.core.rolling.helper

public Class RenameUtil

extends ContextAwareBase
Class Inheritance
Imports
java.io.File, ch.qos.logback.core.CoreConstants, ch.qos.logback.core.rolling.RollingFileAppender, .RolloverFailure, ch.qos.logback.core.spi.ContextAwareBase, ch.qos.logback.core.util.EnvUtil, .FileUtil

Utility class to help solving problems encountered while renaming files.
Author
Ceki Gulcu

Field Summary

Modifier and TypeField and Description
pack-priv static String
Inherited from ch.qos.logback.core.spi.ContextAwareBase:
context

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv Boolean

Returns:

true if on different volumes, false otherwise or if an error occurred
areOnDifferentVolumes
(File srcFile, File targetFile)

Attempts to determine whether both files are on different volumes.

pack-priv void
public void
rename(String src, String target)

A relatively robust file renaming method which in case of failure due to src and target being on different volumes, falls back onto renaming by copying.

public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from ch.qos.logback.core.spi.ContextAwareBase:
addErroraddErroraddInfoaddInfoaddStatusaddWarnaddWarngetContextgetDeclaredOrigingetStatusManagersetContext

Field Detail

RENAMING_ERROR_URLback to summary
pack-priv static String RENAMING_ERROR_URL

Constructor Detail

RenameUtilback to summary
public RenameUtil()

Method Detail

areOnDifferentVolumesback to summary
pack-priv Boolean areOnDifferentVolumes(File srcFile, File targetFile) throws RolloverFailure

Attempts to determine whether both files are on different volumes. Returns true if we could determine that the files are on different volumes. Returns false otherwise or if an error occurred while doing the check.

Returns:Boolean

true if on different volumes, false otherwise or if an error occurred

createMissingTargetDirsIfNecessaryback to summary
pack-priv void createMissingTargetDirsIfNecessary(File toFile) throws RolloverFailure
renameback to summary
public void rename(String src, String target) throws RolloverFailure

A relatively robust file renaming method which in case of failure due to src and target being on different volumes, falls back onto renaming by copying.

renameByCopyingback to summary
public void renameByCopying(String src, String target) throws RolloverFailure
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override