abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r618120 - in /incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server: impl/CollectionAdapterManager.java provider/basic/BasicWorkspace.java
Date Sun, 03 Feb 2008 23:15:46 GMT
Author: dandiep
Date: Sun Feb  3 15:15:40 2008
New Revision: 618120

URL: http://svn.apache.org/viewvc?rev=618120&view=rev
Log:
Fix CollectionAdapterManager so it works if there are spaces in your path. (Also can we please
not have empty catch blocks anymore? Thanks :-) )

Modified:
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/CollectionAdapterManager.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicWorkspace.java

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/CollectionAdapterManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/CollectionAdapterManager.java?rev=618120&r1=618119&r2=618120&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/CollectionAdapterManager.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/impl/CollectionAdapterManager.java
Sun Feb  3 15:15:40 2008
@@ -79,7 +79,10 @@
         .getResources(PROPERTIES_PATH);
     while (e.hasMoreElements()) {
       URL url = e.nextElement();
-      File file = new File(url.getFile());
+      File file = new File(url.toURI());
+      if (!file.exists()) {
+        throw new RuntimeException("Could not convert properties path to a File! \"" + file.getAbsolutePath()
+ "\" does not exist.");
+      }
       File[] files = 
         file.listFiles(
           new FileFilter() {
@@ -88,14 +91,16 @@
             }
           }
         );
-      for (File _file : files) {
-        String name = _file.getName();
-        int i = name.indexOf(PROPERTIES_FILE_SUFFIX);
-        String id = i > -1 ? name.substring(0,i) : null;
-        if (id != null) {
-          Properties properties = loadFeedInfo(id);
-          if (properties != null)
-            results.put(id,properties);
+      if (files != null) {
+        for (File _file : files) {
+          String name = _file.getName();
+          int i = name.indexOf(PROPERTIES_FILE_SUFFIX);
+          String id = i > -1 ? name.substring(0,i) : null;
+          if (id != null) {
+            Properties properties = loadFeedInfo(id);
+            if (properties != null)
+              results.put(id,properties);
+          }
         }
       }
     }

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicWorkspace.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicWorkspace.java?rev=618120&r1=618119&r2=618120&view=diff
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicWorkspace.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/basic/BasicWorkspace.java
Sun Feb  3 15:15:40 2008
@@ -51,7 +51,9 @@
         SimpleCollectionInfo col = new SimpleCollectionInfo(title,href,"application/atom+xml;type=entry");
         collections.add(col);
       }
-    } catch (Exception e) {}
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
     return collections;
   }
 



Mime
View raw message