ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/45] incubator-ignite git commit: # ignite-1037
Date Tue, 30 Jun 2015 08:03:57 GMT
# ignite-1037


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/65964e26
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/65964e26
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/65964e26

Branch: refs/heads/ignite-961
Commit: 65964e26a7519e77f55a0320b37782f83bef229b
Parents: 1c66078
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Tue Jun 23 10:14:38 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Tue Jun 23 10:14:38 2015 +0700

----------------------------------------------------------------------
 .../internal/util/GridConfigurationFinder.java  | 55 +++++++++++---------
 1 file changed, 29 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65964e26/modules/core/src/main/java/org/apache/ignite/internal/util/GridConfigurationFinder.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/GridConfigurationFinder.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/GridConfigurationFinder.java
index bc9a13f..37d8756 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/GridConfigurationFinder.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/GridConfigurationFinder.java
@@ -106,45 +106,48 @@ public final class GridConfigurationFinder {
 
         LinkedList<GridTuple3<String, Long, File>> paths = new LinkedList<>();
 
-        for (String name : dir.list()) {
-            File file = new File(dir, name);
+        String[] configs = dir.list();
 
-            if (file.isDirectory())
-                paths.addAll(listFiles(file));
-            else if (file.getName().endsWith(".xml")) {
-                try (BufferedReader reader = new BufferedReader(new FileReader(file))) {
-                    boolean springCfg = false;
-                    boolean ggCfg = false;
+        if (configs != null)
+            for (String name : configs) {
+                File file = new File(dir, name);
 
-                    String line;
+                if (file.isDirectory())
+                    paths.addAll(listFiles(file));
+                else if (file.getName().endsWith(".xml")) {
+                    try (BufferedReader reader = new BufferedReader(new FileReader(file)))
{
+                        boolean springCfg = false;
+                        boolean ggCfg = false;
 
-                    while ((line = reader.readLine()) != null) {
-                        if (line.contains("http://www.springframework.org/schema/beans"))
-                            springCfg = true;
+                        String line;
 
-                        if (line.contains("class=\"org.apache.ignite.configuration.IgniteConfiguration\""))
-                            ggCfg = true;
+                        while ((line = reader.readLine()) != null) {
+                            if (line.contains("http://www.springframework.org/schema/beans"))
+                                springCfg = true;
 
-                        if (springCfg && ggCfg)
-                            break;
-                    }
+                            if (line.contains("class=\"org.apache.ignite.configuration.IgniteConfiguration\""))
+                                ggCfg = true;
+
+                            if (springCfg && ggCfg)
+                                break;
+                        }
 
-                    if (springCfg) {
-                        String path = file.getAbsolutePath().substring(U.getIgniteHome().length());
+                        if (springCfg) {
+                            String path = file.getAbsolutePath().substring(U.getIgniteHome().length());
 
-                        if (path.startsWith(File.separator))
-                            path = path.substring(File.separator.length());
+                            if (path.startsWith(File.separator))
+                                path = path.substring(File.separator.length());
 
-                        if (!path.equals(DFLT_CFG)) {
-                            if (!ggCfg)
-                                path = Q_PREFIX + ' ' + path;
+                            if (!path.equals(DFLT_CFG)) {
+                                if (!ggCfg)
+                                    path = Q_PREFIX + ' ' + path;
 
-                            paths.add(F.t(path, file.lastModified(), file));
+                                paths.add(F.t(path, file.lastModified(), file));
+                            }
                         }
                     }
                 }
             }
-        }
 
         return paths;
     }


Mime
View raw message