svn commit: r776980 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/FileUtil.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r776980 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/FileUtil.java

adrianc
Author: adrianc
Date: Thu May 21 07:02:17 2009
New Revision: 776980

URL: http://svn.apache.org/viewvc?rev=776980&view=rev
Log:
FileUtil.java improvements.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/FileUtil.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/FileUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/FileUtil.java?rev=776980&r1=776979&r2=776980&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/FileUtil.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/FileUtil.java Thu May 21 07:02:17 2009
@@ -214,6 +214,9 @@
     public static void searchFiles(List<File> fileList, File path, FilenameFilter filter, boolean includeSubfolders) throws IOException {
         // Get filtered files in the current path
         File[] files = path.listFiles(filter);
+        if (files == null) {
+            return;
+        }
 
         // Process each filtered entry
         for (int i = 0; i < files.length; i++) {
@@ -299,6 +302,9 @@
             }
 
             if (hasAllPathStrings && name.endsWith("." + fileExtension)) {
+                if (stringsToFindInFile.size() == 0) {
+                    return true;
+                }
                 StringBuffer xmlFileBuffer = null;
                 try {
                     xmlFileBuffer = FileUtil.readTextFile(file, true);