Browse Source

Fix Logging plugin for new ReverseFileReader.

Depends-On: I921a395e088846216650d1ac14207cb915a6bb8c
Change-Id: If51c7d7214b560c656250f6157a5dc2d2a15894d
Reviewed-on: http://gerrit.dmdirc.com/4046
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
changes/46/4046/5
Greg Holmes 9 years ago
parent
commit
d3f6d41c3f
1 changed files with 7 additions and 4 deletions
  1. 7
    4
      logging/src/com/dmdirc/addons/logging/LoggingManager.java

+ 7
- 4
logging/src/com/dmdirc/addons/logging/LoggingManager.java View File

@@ -67,6 +67,9 @@ import java.io.File;
67 67
 import java.io.FileWriter;
68 68
 import java.io.IOException;
69 69
 import java.math.BigInteger;
70
+import java.nio.file.Files;
71
+import java.nio.file.Path;
72
+import java.nio.file.Paths;
70 73
 import java.security.MessageDigest;
71 74
 import java.security.NoSuchAlgorithmException;
72 75
 import java.text.DateFormat;
@@ -410,8 +413,8 @@ public class LoggingManager implements ConfigChangeListener {
410 413
             return;
411 414
         }
412 415
 
413
-        final File testFile = new File(filename);
414
-        if (testFile.exists()) {
416
+        final Path testFile = Paths.get(filename);
417
+        if (Files.exists(testFile)) {
415 418
             try {
416 419
                 final ReverseFileReader file = new ReverseFileReader(testFile);
417 420
                 // Because the file includes a newline char at the end, an empty line
@@ -768,9 +771,9 @@ public class LoggingManager implements ConfigChangeListener {
768 771
             return false;
769 772
         }
770 773
 
771
-        final String log = getLogFile(descriptor);
774
+        final Path log = Paths.get(getLogFile(descriptor));
772 775
 
773
-        if (!new File(log).exists()) {
776
+        if (!Files.exists(log)) {
774 777
             // File doesn't exist
775 778
             return false;
776 779
         }

Loading…
Cancel
Save