Class RenameUtil
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.rolling.helper.RenameUtil
- All Implemented Interfaces:
ContextAware
Utility class to help solving problems encountered while renaming files.
-
Field Summary
FieldsFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Boolean
areOnDifferentVolumes
(File srcFile, File targetFile) Attempts to determine whether both files are on different volumes.(package private) void
void
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.void
renameByCopying
(String src, String target) toString()
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
Field Details
-
RENAMING_ERROR_URL
-
-
Constructor Details
-
RenameUtil
public RenameUtil()
-
-
Method Details
-
rename
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.- Parameters:
src
-target
-- Throws:
RolloverFailure
-
areOnDifferentVolumes
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.- Parameters:
srcFile
-targetFile
-- Returns:
- true if on different volumes, false otherwise or if an error occurred
- Throws:
RolloverFailure
-
renameByCopying
- Throws:
RolloverFailure
-
createMissingTargetDirsIfNecessary
- Throws:
RolloverFailure
-
toString
-