diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-07-22 14:21:18 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-07-22 14:21:18 +0000 |
| commit | 167570b1632574a9e81e8f2a62e58d537a88dd12 (patch) | |
| tree | 141012a86dfb8e32870c8536b75c2d7f5c5756e0 /java | |
| parent | 5d4b86fa9837492193f29c21d9dd3518fd6d06b3 (diff) | |
| download | qpid-python-167570b1632574a9e81e8f2a62e58d537a88dd12.tar.gz | |
QPID-2740 : Update to use backupFilesToPath for non-compressed files.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@966678 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java b/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java index 1ad04af274..83a6ff705d 100644 --- a/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java +++ b/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java @@ -629,6 +629,11 @@ public class QpidCompositeRollingAppender extends FileAppender return; } + if (backupFilesToPath != null) + { + to = backupFilesToPath + System.getProperty("file.separator") + new File(to).getName(); + } + File target = new File(to); File file = new File(from); @@ -690,16 +695,9 @@ public class QpidCompositeRollingAppender extends FileAppender // for the file we are trying to delete if (backupFilesToPath != null) { - int index = relativeFileName.lastIndexOf(File.separator); - if (index != -1) - { - fileName = backupFilesToPath + File.separator - + relativeFileName.substring(index); - } - else - { - fileName = relativeFileName; - } + File file = new File(relativeFileName); + + fileName = backupFilesToPath + System.getProperty("file.separator") + file.getName(); } // If we are compressing the at the extension @@ -1025,14 +1023,8 @@ public class QpidCompositeRollingAppender extends FileAppender protected synchronized void doCompress(File from, File to) { String toFile; - if (backupFilesToPath == null) - { - toFile = to.getPath() + COMPRESS_EXTENSION; - } - else - { - toFile = backupFilesToPath + System.getProperty("file.separator") + to.getName() + COMPRESS_EXTENSION; - } + + toFile = to.getPath() + COMPRESS_EXTENSION; File target = new File(toFile); if (target.exists()) |
