From e0e05442f5536b2e2bb57dc9ebd8a051d7787a53 Mon Sep 17 00:00:00 2001
From: brinn <brinn>
Date: Sun, 23 Sep 2007 11:26:43 +0000
Subject: [PATCH] refactor: FileUtilities.listFiles() -> tryListFiles()
 refactor: IReadPathOperations.listFiles() -> tryListFiles()

SVN: 1817
---
 .../ch/systemsx/cisd/datamover/IncomingProcessor.java     | 4 ++--
 .../java/ch/systemsx/cisd/datamover/LocalProcessor.java   | 4 ++--
 .../datamover/filesystem/FileSysOperationsFactory.java    | 8 ++++----
 .../datamover/filesystem/intf/IReadPathOperations.java    | 4 ++--
 .../filesystem/remote/CopyActivityMonitorTest.java        | 8 ++++----
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/IncomingProcessor.java b/datamover/source/java/ch/systemsx/cisd/datamover/IncomingProcessor.java
index 8c85e922b1b..119ffc8b710 100644
--- a/datamover/source/java/ch/systemsx/cisd/datamover/IncomingProcessor.java
+++ b/datamover/source/java/ch/systemsx/cisd/datamover/IncomingProcessor.java
@@ -235,7 +235,7 @@ public class IncomingProcessor
 
         private void recoverIncomingInProgress(FileStore incomingStore, File copyInProgressDir, File copyCompleteDir)
         {
-            final File[] files = incomingReadOperations.listFiles(copyInProgressDir, errorLog);
+            final File[] files = incomingReadOperations.tryListFiles(copyInProgressDir, errorLog);
             if (files == null || files.length == 0)
             {
                 return; // directory is empty, no recovery is needed
@@ -294,7 +294,7 @@ public class IncomingProcessor
         // schedule processing of all resources which were previously copied
         private void recoverIncomingCopyComplete(File copyCompleteDir, IPathHandler localProcessor)
         {
-            final File[] files = incomingReadOperations.listFiles(copyCompleteDir, errorLog);
+            final File[] files = incomingReadOperations.tryListFiles(copyCompleteDir, errorLog);
             if (files == null || files.length == 0)
             {
                 return; // directory is empty, no recovery is needed
diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java b/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java
index da7244f0ecb..b48ccc18a68 100644
--- a/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java
+++ b/datamover/source/java/ch/systemsx/cisd/datamover/LocalProcessor.java
@@ -99,7 +99,7 @@ public class LocalProcessor implements IPathHandler
 
     private void recoverTemporaryExtraCopy(File inputDir)
     {
-        final File[] files = readOperations.listFiles(tempDir, errorLog);
+        final File[] files = readOperations.tryListFiles(tempDir, errorLog);
         if (files == null || files.length == 0)
         {
             return; // directory is empty, no recovery is needed
@@ -131,7 +131,7 @@ public class LocalProcessor implements IPathHandler
 
     private void recoverRegisterReadyForOutgoing()
     {
-        File[] files = readOperations.listFiles(outputDir, errorLog);
+        File[] files = readOperations.tryListFiles(outputDir, errorLog);
         if (files == null || files.length == 0)
         {
             return; // directory is empty, no recovery is needed
diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/FileSysOperationsFactory.java b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/FileSysOperationsFactory.java
index c648a4f2a13..aa8d7c72533 100644
--- a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/FileSysOperationsFactory.java
+++ b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/FileSysOperationsFactory.java
@@ -89,14 +89,14 @@ public class FileSysOperationsFactory implements IFileSysOperationsFactory
                 return FileUtilities.lastChanged(path);
             }
 
-            public File[] listFiles(File directory, FileFilter filter, ISimpleLogger loggerOrNull)
+            public File[] tryListFiles(File directory, FileFilter filter, ISimpleLogger loggerOrNull)
             {
-                return FileUtilities.listFiles(directory, filter, loggerOrNull);
+                return FileUtilities.tryListFiles(directory, filter, loggerOrNull);
             }
 
-            public File[] listFiles(File directory, ISimpleLogger loggerOrNull)
+            public File[] tryListFiles(File directory, ISimpleLogger loggerOrNull)
             {
-                return FileUtilities.listFiles(directory, FileUtilities.ACCEPT_ALL_FILTER, loggerOrNull);
+                return FileUtilities.tryListFiles(directory, FileUtilities.ACCEPT_ALL_FILTER, loggerOrNull);
             }
         };
     }
diff --git a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/IReadPathOperations.java b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/IReadPathOperations.java
index e7393468ed7..e4f12636828 100644
--- a/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/IReadPathOperations.java
+++ b/datamover/source/java/ch/systemsx/cisd/datamover/filesystem/intf/IReadPathOperations.java
@@ -33,10 +33,10 @@ public interface IReadPathOperations
      * 
      * @param loggerOrNull logger, if <code>null</code> than no logging occurs
      */
-    File[] listFiles(File directory, FileFilter filter, ISimpleLogger loggerOrNull);
+    File[] tryListFiles(File directory, FileFilter filter, ISimpleLogger loggerOrNull);
 
     /** lists all files in a given directory, logs errors */
-    File[] listFiles(File directory, ISimpleLogger logger);
+    File[] tryListFiles(File directory, ISimpleLogger logger);
 
     /** checks if a file exists */
     boolean exists(File file);
diff --git a/datamover/sourceTest/java/ch/systemsx/cisd/datamover/filesystem/remote/CopyActivityMonitorTest.java b/datamover/sourceTest/java/ch/systemsx/cisd/datamover/filesystem/remote/CopyActivityMonitorTest.java
index 650c6462532..adb166e9d02 100644
--- a/datamover/sourceTest/java/ch/systemsx/cisd/datamover/filesystem/remote/CopyActivityMonitorTest.java
+++ b/datamover/sourceTest/java/ch/systemsx/cisd/datamover/filesystem/remote/CopyActivityMonitorTest.java
@@ -121,14 +121,14 @@ public class CopyActivityMonitorTest
             return impl.exists(file);
         }
 
-        public File[] listFiles(File directory, FileFilter filter, ISimpleLogger loggerOrNull)
+        public File[] tryListFiles(File directory, FileFilter filter, ISimpleLogger loggerOrNull)
         {
-            return impl.listFiles(directory, filter, loggerOrNull);
+            return impl.tryListFiles(directory, filter, loggerOrNull);
         }
 
-        public File[] listFiles(File directory, ISimpleLogger logger)
+        public File[] tryListFiles(File directory, ISimpleLogger logger)
         {
-            return impl.listFiles(directory, logger);
+            return impl.tryListFiles(directory, logger);
         }
     }
 
-- 
GitLab