clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1458233 - in /clerezza/trunk/rdf.jena.tdb.storage/src: main/java/org/apache/clerezza/rdf/jena/tdb/storage/ test/java/org/apache/clerezza/rdf/jena/tdb/storage/
Date Tue, 19 Mar 2013 11:36:22 GMT
Author: reto
Date: Tue Mar 19 11:36:21 2013
New Revision: 1458233

URL: http://svn.apache.org/r1458233
Log:
CLEREZZA-749: not solving the issue but causing more meaningfull and earlier exceptions

Modified:
    clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProvider.java
    clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/MultiThreadedSingleTdbDatasetTest.java
    clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetMGraphTest.java
    clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProviderTest.java
    clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbMGraphTest.java
    clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProviderTest.java

Modified: clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProvider.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProvider.java?rev=1458233&r1=1458232&r2=1458233&view=diff
==============================================================================
--- clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProvider.java
(original)
+++ clerezza/trunk/rdf.jena.tdb.storage/src/main/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProvider.java
Tue Mar 19 11:36:21 2013
@@ -27,10 +27,12 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
+import java.nio.file.Files;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.logging.Level;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -245,7 +247,11 @@ public class TdbTcProvider implements We
                 dir2Dataset.get(tcDir).close();
                 dir2Dataset.remove(tcDir);
             }
-            delete(tcDir);
+            try {
+                delete(tcDir);
+            } catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
             return true;
         }
         return false;
@@ -255,7 +261,7 @@ public class TdbTcProvider implements We
      * Cleans the content of the specified directory recursively.
      * @param dir  Abstract path denoting the directory to clean.
      */
-    private static void cleanDirectory(File dir) {
+    private static void cleanDirectory(File dir) throws IOException {
         File[] files = dir.listFiles();
         if (files != null && files.length > 0) {
             for (File file : files) {
@@ -268,11 +274,11 @@ public class TdbTcProvider implements We
      * Deletes the specified file or directory.
      * @param file  Abstract path denoting the file or directory to clean.
      */
-    protected static void delete(File file) {
+    protected static void delete(File file) throws IOException {
         if (file.isDirectory()) {
             cleanDirectory(file);
         }
-        file.delete();
+        Files.delete(file.toPath());
     }
 
     @Override

Modified: clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/MultiThreadedSingleTdbDatasetTest.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/MultiThreadedSingleTdbDatasetTest.java?rev=1458233&r1=1458232&r2=1458233&view=diff
==============================================================================
--- clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/MultiThreadedSingleTdbDatasetTest.java
(original)
+++ clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/MultiThreadedSingleTdbDatasetTest.java
Tue Mar 19 11:36:21 2013
@@ -255,7 +255,7 @@ public class MultiThreadedSingleTdbDatas
         Assert.assertEquals(addedTriples, graphTriples);
     }
     @AfterClass
-    public static void cleanUpDirectory() {
+    public static void cleanUpDirectory() throws IOException {
         provider.deactivate(null);
         TdbTcProvider.delete(tempFile);
     }

Modified: clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetMGraphTest.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetMGraphTest.java?rev=1458233&r1=1458232&r2=1458233&view=diff
==============================================================================
--- clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetMGraphTest.java
(original)
+++ clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetMGraphTest.java
Tue Mar 19 11:36:21 2013
@@ -33,7 +33,7 @@ public class SingleTdbDatasetMGraphTest 
         provider = new SingleTdbDatasetTcProvider(config);
     }
     @AfterClass
-    public static void cleanUpDirectory() {
+    public static void cleanUpDirectory() throws IOException {
         for(int i = 0; i < testGraphCounter;i++){
             provider.deleteTripleCollection(new UriRef(MGRAPHNAME_PREFIX+i));
         }

Modified: clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProviderTest.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProviderTest.java?rev=1458233&r1=1458232&r2=1458233&view=diff
==============================================================================
--- clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProviderTest.java
(original)
+++ clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/SingleTdbDatasetTcProviderTest.java
Tue Mar 19 11:36:21 2013
@@ -64,7 +64,7 @@ public class SingleTdbDatasetTcProviderT
         return provider;
     }
     @After
-    public void cleanData(){
+    public void cleanData() throws IOException{
         //We need to remove all remaining data after a test
         if(provider != null){
             provider.deactivate(null);

Modified: clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbMGraphTest.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbMGraphTest.java?rev=1458233&r1=1458232&r2=1458233&view=diff
==============================================================================
--- clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbMGraphTest.java
(original)
+++ clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbMGraphTest.java
Tue Mar 19 11:36:21 2013
@@ -54,7 +54,7 @@ public class TdbMGraphTest extends MGrap
     }
 
     @AfterClass
-    public static void cleanUpDirectory() {
+    public static void cleanUpDirectory() throws IOException {
         TdbTcProvider.delete(tempFile);
     }
 

Modified: clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProviderTest.java
URL: http://svn.apache.org/viewvc/clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProviderTest.java?rev=1458233&r1=1458232&r2=1458233&view=diff
==============================================================================
--- clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProviderTest.java
(original)
+++ clerezza/trunk/rdf.jena.tdb.storage/src/test/java/org/apache/clerezza/rdf/jena/tdb/storage/TdbTcProviderTest.java
Tue Mar 19 11:36:21 2013
@@ -46,7 +46,7 @@ public class TdbTcProviderTest extends T
     }
 
     @After
-    public void cleanUp() {
+    public void cleanUp() throws IOException {
         TdbTcProvider.delete(tempFile);
     }
 



Mime
View raw message