sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
Subject svn commit: r1032871 - /incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
Date Tue, 09 Nov 2010 07:06:41 GMT
Author: mattmann
Date: Tue Nov  9 07:06:41 2010
New Revision: 1032871

URL: http://svn.apache.org/viewvc?rev=1032871&view=rev
Log:
- fix for SIS-22 Error obtaining geodata RSS causes Qtree index to not be written

Modified:
    incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java

Modified: incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
URL: http://svn.apache.org/viewvc/incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java?rev=1032871&r1=1032870&r2=1032871&view=diff
==============================================================================
--- incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
(original)
+++ incubator/sis/trunk/sis-core/src/main/java/org/apache/sis/storage/QuadTreeWriter.java
Tue Nov  9 07:06:41 2010
@@ -37,12 +37,20 @@ public class QuadTreeWriter {
    * @param directory
    */
   public static void writeTreeToFile(QuadTree tree, String directory) {
+    createIdxDir(directory);
     writeTreeConfigsToFile(tree, directory);
     writeNodeToFile(tree.getRoot(), directory);
   }
 
+  private static void createIdxDir(String directory) {
+    File dir = new File(directory);
+    if (!dir.exists()) {
+      System.out.println("[INFO] Creating qtree idx dir: [" + directory + "]");
+      new File(directory).mkdirs();
+    }
+  }
+
   private static void writeTreeConfigsToFile(QuadTree tree, String directory) {
-    if(!new File(directory).exists()) new File(directory).mkdirs();
     try {
       BufferedWriter writer = new BufferedWriter(new FileWriter(directory
           + "tree_config.txt"));



Mime
View raw message