You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2014/11/10 11:53:26 UTC

[21/50] [abbrv] jena git commit: Switch to "Location.create" from "new Location" for directory locations.

Switch to "Location.create" from "new Location" for directory locations.


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/140a0889
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/140a0889
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/140a0889

Branch: refs/heads/eliminate-assignments
Commit: 140a08890804a758cf37858a332a32f857920446
Parents: a9c7671
Author: Andy Seaborne <an...@apache.org>
Authored: Wed Nov 5 13:40:36 2014 +0000
Committer: Andy Seaborne <an...@apache.org>
Committed: Wed Nov 5 15:06:44 2014 +0000

----------------------------------------------------------------------
 .../jena/tdb/assembler/DatasetAssemblerTDB.java |  2 +-
 .../jena/tdb/assembler/NodeTableAssembler.java  |  4 +--
 .../jena/tdb/assembler/TDBGraphAssembler.java   |  2 +-
 .../com/hp/hpl/jena/tdb/base/file/FileSet.java  |  4 +--
 .../com/hp/hpl/jena/tdb/base/file/Location.java | 10 ++++--
 .../tdb/store/bulkloader2/CmdIndexBuild.java    |  2 +-
 .../tdb/store/bulkloader2/CmdIndexCopy.java     |  4 +--
 .../store/bulkloader2/CmdNodeTableBuilder.java  |  2 +-
 .../java/com/hp/hpl/jena/tdb/sys/DebugTDB.java  |  2 +-
 .../java/com/hp/hpl/jena/tdb/sys/TDBMaker.java  | 32 +++++++++++++-------
 jena-tdb/src/main/java/tdb/CmdRewriteIndex.java |  4 +--
 .../src/main/java/tdb/cmdline/ModLocation.java  |  2 +-
 .../main/java/tdb/cmdline/ModTDBDataset.java    |  2 +-
 .../src/main/java/tdb/tools/dumpnodetable.java  |  2 +-
 .../src/main/java/tdb/tools/tdbgenindex.java    |  4 +--
 .../jena/tdb/base/file/TestLocationLock.java    | 12 ++++----
 .../tdb/base/objectfile/TestStringFileDisk.java |  2 +-
 .../hpl/jena/tdb/extra/T_QuadsObjectIsNull.java |  2 +-
 .../jena/tdb/extra/T_TDBWriteTransaction.java   |  2 +-
 .../hp/hpl/jena/tdb/extra/T_TransSystem.java    |  6 ++--
 .../tdb/extra/T_TransSystemMultiDatasets.java   |  4 +--
 .../jena/tdb/graph/TestPrefixMappingTDB.java    |  6 ++--
 .../jena/tdb/store/TestDatasetTDBPersist.java   |  2 +-
 .../com/hp/hpl/jena/tdb/store/TestGraphTDB.java |  2 +-
 .../tdb/transaction/TestNodeTableTransDisk.java |  2 +-
 .../transaction/TestObjectFileTransStorage.java |  4 +--
 .../jena/tdb/transaction/TestTransRestart.java  |  2 +-
 .../tdb/transaction/TestTransactionTDB.java     |  2 +-
 28 files changed, 71 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/DatasetAssemblerTDB.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/DatasetAssemblerTDB.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/DatasetAssemblerTDB.java
index 45634d5..b415c5c 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/DatasetAssemblerTDB.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/DatasetAssemblerTDB.java
@@ -54,7 +54,7 @@ public class DatasetAssemblerTDB extends DatasetAssembler
             throw new AssemblerException(root, "No location given") ;
 
         String dir = getStringValue(root, pLocation) ;
-        Location loc = new Location(dir) ;
+        Location loc = Location.create(dir) ;
         DatasetGraph dsg = TDBFactory.createDatasetGraph(loc) ;
 
         if ( root.hasProperty(pUnionDefaultGraph) ) {

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/NodeTableAssembler.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/NodeTableAssembler.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/NodeTableAssembler.java
index da9b869..cc83a99 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/NodeTableAssembler.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/NodeTableAssembler.java
@@ -42,7 +42,7 @@ public class NodeTableAssembler extends AssemblerBase //implements Assembler
 
     //private Location location = null ;
     
-    //public NodeTableAssembler()                     { this.location = new Location(".") ; }
+    //public NodeTableAssembler()                     { this.location = Location.create(".") ; }
     //public NodeTableAssembler(Location location)    { this.location = location ; }
     
     public NodeTableAssembler()                     { }
@@ -52,7 +52,7 @@ public class NodeTableAssembler extends AssemblerBase //implements Assembler
     {
         String location = getAsStringValue(root, pNodeIndex) ;
 //        if ( location != null )
-//            return NodeTableFactory.create(IndexBuilder.get(), new Location(location)) ;
+//            return NodeTableFactory.create(IndexBuilder.get(), Location.create(location)) ;
 //        
 //        String nodeIndex = getAsStringValue(root, pNodeIndex) ;
 //        String nodeData = getAsStringValue(root, pNodeData) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/TDBGraphAssembler.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/TDBGraphAssembler.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/TDBGraphAssembler.java
index 5cf11a7..3801e30 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/TDBGraphAssembler.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/assembler/TDBGraphAssembler.java
@@ -79,7 +79,7 @@ public class TDBGraphAssembler extends AssemblerBase implements Assembler
         
         if ( locationDir != null )
         {
-            Location location = new Location(locationDir) ;
+            Location location = Location.create(locationDir) ;
             ds = TDBFactory.createDataset(location) ;
         }
         else

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/FileSet.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/FileSet.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/FileSet.java
index fd5924a..55a2376 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/FileSet.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/FileSet.java
@@ -50,7 +50,7 @@ public class FileSet
     /** Create a FileSet given Location (directory) and name within the directory */  
     public FileSet(String directory, String basename)
     {
-        initFileSet(new Location(directory), basename) ;
+        initFileSet(Location.create(directory), basename) ;
     }
     
     /** Create a FileSet given Location (directory) and name within the directory */  
@@ -61,7 +61,7 @@ public class FileSet
         String fn = t.get(1) ;
         if ( dir == null )
             dir = "." ;
-        initFileSet(new Location(dir), fn) ;
+        initFileSet(Location.create(dir), fn) ;
     }
     
     /** Create a FileSet given Location (directory) and name within the directory */  

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/Location.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/Location.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/Location.java
index 46ae71c..0d18d51 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/Location.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/base/file/Location.java
@@ -53,11 +53,17 @@ public class Location {
 
     /** Return a memory location with a name */
     static public Location mem(String name) {
-        Location loc = new Location() ;
+        Location loc = Location.mem() ;
         memInit(loc, name) ;
         return loc ;
     }
 
+    /** Return a location for a directory on disk */
+    static public Location create(String directoryName) {
+        Location loc = Location.create(directoryName) ;
+        return loc ;
+    }
+
     private Location() {}
 
     private static void memInit(Location location, String name) {
@@ -142,7 +148,7 @@ public class Location {
     public Location getSubLocation(String dirname) {
         String newName = pathname + dirname ;
         ensure(newName) ;
-        return new Location(newName) ;
+        return Location.create(newName) ;
     }
 
     private void ensure(String dirname) {

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java
index 24c28d4..d64d108 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexBuild.java
@@ -69,7 +69,7 @@ public class CmdIndexBuild
         
         // Argument processing
         
-        Location location = new Location(locationStr) ;
+        Location location = Location.create(locationStr) ;
         
         //InputStream input = System.in ;
         InputStream input = IO.openFile(dataFile) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
index 0c83268..fdf04cc 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdIndexCopy.java
@@ -70,8 +70,8 @@ public class CmdIndexCopy
         
         // Argument processing
         
-        Location location1 = new Location(locationStr1) ;
-        Location location2 = new Location(locationStr2) ;
+        Location location1 = Location.create(locationStr1) ;
+        Location location2 = Location.create(locationStr2) ;
         
         int keyLength = SystemTDB.SizeOfNodeId * indexName1.length() ;
         int valueLength = 0 ;

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
index d436eac..1782de6 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/store/bulkloader2/CmdNodeTableBuilder.java
@@ -96,7 +96,7 @@ public class CmdNodeTableBuilder extends CmdGeneral
 //        if ( !super.contains(argQuadsOut) ) throw new CmdException("Required: --quads FILE") ;
         
         locationString   = super.getValue(argLocation) ;
-        location = new Location(locationString) ;
+        location = Location.create(locationString) ;
 
         dataFileTriples  = super.getValue(argTriplesOut) ;
         if ( dataFileTriples == null )

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java
index 4ab8be5..a721a7f 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/DebugTDB.java
@@ -77,7 +77,7 @@ public class DebugTDB
     
     public static void dumpNodeIndex(String dir)
     {
-        Location location = new Location(dir) ;
+        Location location = Location.create(dir) ;
         Index nodeToId = SetupTDB.makeIndex(location, Names.indexNode2Id, SystemTDB.BlockSize, SystemTDB.LenNodeHash, SystemTDB.SizeOfNodeId, -1 ,-1) ;
         for ( Record aNodeToId : nodeToId )
         {

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java
index 45620e2..e966252 100644
--- a/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java
+++ b/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/sys/TDBMaker.java
@@ -23,6 +23,7 @@ import com.hp.hpl.jena.tdb.StoreConnection ;
 import com.hp.hpl.jena.tdb.TDBFactory ;
 import com.hp.hpl.jena.tdb.base.file.Location ;
 import com.hp.hpl.jena.tdb.setup.DatasetBuilderStd ;
+import com.hp.hpl.jena.tdb.setup.StoreParams ;
 import com.hp.hpl.jena.tdb.store.DatasetGraphTDB ;
 import com.hp.hpl.jena.tdb.transaction.DatasetGraphTransaction ;
 
@@ -36,7 +37,7 @@ public class TDBMaker
     /** Create a DatasetGraph that supports transactions */  
     public static DatasetGraphTransaction createDatasetGraphTransaction(String location)
     {
-        return createDatasetGraphTransaction(new Location(location)) ;
+        return createDatasetGraphTransaction(Location.create(location)) ;
     }
     
     /** Create a Dataset that supports transactions */  
@@ -72,35 +73,44 @@ public class TDBMaker
     /* The one we are using */
     private static DatasetGraphMakerTDB builder = new BuilderStd() ;
 
-    public static DatasetGraphTDB createDatasetGraphTDB(Location loc)
-    { return builder.createDatasetGraph(loc) ; }
+    
+    public static DatasetGraphTDB createDatasetGraphTDB(Location loc, StoreParams params)
+    { return builder.createDatasetGraph(loc, params) ; }
 
+    
+    @Deprecated
+    public static DatasetGraphTDB createDatasetGraphTDB(Location loc) {
+        return createDatasetGraphTDB(loc, null) ;
+    }
+    
     // -- Different ways of doing it.
     
     /** Interface to maker of the actual implementations of TDB datasets */ 
     private interface DatasetGraphMakerTDB 
     {
         /** Create a TDB-backed dataset at a given location */
-        public DatasetGraphTDB createDatasetGraph(Location location) ;
+        public DatasetGraphTDB createDatasetGraph(Location location, StoreParams params) ;
     }
 
     /** Make directly the base DatasetGraphTDB */
     private static class BuilderStd implements DatasetGraphMakerTDB
     {
         @Override
-        public DatasetGraphTDB createDatasetGraph(Location location)
+        public DatasetGraphTDB createDatasetGraph(Location location, StoreParams params)
         {
-            return DatasetBuilderStd.create(location) ;
+            return DatasetBuilderStd.create(location, params) ;
         }
     }
     
     /** Make by creating the normal, transactional one and finding the base */ 
-    private static class BuilderBase implements DatasetGraphMakerTDB
+    private static class _BuilderBase implements DatasetGraphMakerTDB
     {
         @Override
-        public DatasetGraphTDB createDatasetGraph(Location location)
+        public DatasetGraphTDB createDatasetGraph(Location location, StoreParams params)
         {
-            DatasetGraph dsg = TDBFactory.createDatasetGraph(location) ;
+            if ( params != null )
+                System.err.println("StoreParams != null : ignored at the moment") ;
+            DatasetGraph dsg = TDBFactory.createDatasetGraph(location) ; // , params) ;
             return TDBInternal.getBaseDatasetGraphTDB(dsg) ;
         }
     }
@@ -109,9 +119,9 @@ public class TDBMaker
     private static class BuilderStoreConnectionBase implements DatasetGraphMakerTDB
     {
         @Override
-        public DatasetGraphTDB createDatasetGraph(Location location)
+        public DatasetGraphTDB createDatasetGraph(Location location, StoreParams params)
         {
-            return StoreConnection.make(location).getBaseDataset() ;
+            return StoreConnection.make(location, params).getBaseDataset() ;
         }
     }
     

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java b/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java
index a7341f0..a8353bf 100644
--- a/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java
+++ b/jena-tdb/src/main/java/tdb/CmdRewriteIndex.java
@@ -49,8 +49,8 @@ public class CmdRewriteIndex
             System.exit(1) ;
         }
         
-        Location srcLoc = new Location(argv[0]) ;
-        Location dstLoc = new Location(argv[1]) ;
+        Location srcLoc = Location.create(argv[0]) ;
+        Location dstLoc = Location.create(argv[1]) ;
         String indexName = argv[2] ;
         
         if ( ! FileOps.exists(argv[1]) )

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/tdb/cmdline/ModLocation.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/tdb/cmdline/ModLocation.java b/jena-tdb/src/main/java/tdb/cmdline/ModLocation.java
index 8b5dc25..fba78bf 100644
--- a/jena-tdb/src/main/java/tdb/cmdline/ModLocation.java
+++ b/jena-tdb/src/main/java/tdb/cmdline/ModLocation.java
@@ -49,7 +49,7 @@ public class ModLocation implements ArgModuleGeneral
         if ( cmdLine.contains(locationDecl) )
         {
             String dir = cmdLine.getValue(locationDecl) ;
-            location = new Location(dir) ;
+            location = Location.create(dir) ;
         }
     }
     

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/tdb/cmdline/ModTDBDataset.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/tdb/cmdline/ModTDBDataset.java b/jena-tdb/src/main/java/tdb/cmdline/ModTDBDataset.java
index ee87b42..0740e75 100644
--- a/jena-tdb/src/main/java/tdb/cmdline/ModTDBDataset.java
+++ b/jena-tdb/src/main/java/tdb/cmdline/ModTDBDataset.java
@@ -108,7 +108,7 @@ public class ModTDBDataset extends ModDataset
         List<String> x = locations() ;
         if ( x.size() == 0 )
             return null ;
-        return new Location(x.get(0)) ;
+        return Location.create(x.get(0)) ;
     }
     
     public List<String> locations()

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java b/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java
index 6e13787..fcd2666 100644
--- a/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java
+++ b/jena-tdb/src/main/java/tdb/tools/dumpnodetable.java
@@ -89,7 +89,7 @@ public class dumpnodetable extends CmdGeneral
 
                             int sizeNodeMissCacheSize)
     {
-        NodeTable nodeTable = Build.makeNodeTable(new Location(location), 
+        NodeTable nodeTable = Build.makeNodeTable(Location.create(location), 
                                                     indexNode2Id, node2NodeIdCacheSize,
                                                     indexId2Node, nodeId2NodeCacheSize,
                                                     sizeNodeMissCacheSize) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/main/java/tdb/tools/tdbgenindex.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/main/java/tdb/tools/tdbgenindex.java b/jena-tdb/src/main/java/tdb/tools/tdbgenindex.java
index 9faf239..723a964 100644
--- a/jena-tdb/src/main/java/tdb/tools/tdbgenindex.java
+++ b/jena-tdb/src/main/java/tdb/tools/tdbgenindex.java
@@ -42,10 +42,10 @@ public class tdbgenindex
             System.exit(1) ;
         }
         
-        Location srcLoc = new Location(argv[0]) ;
+        Location srcLoc = Location.create(argv[0]) ;
         String srcIndexName = argv[1] ;
         
-        Location dstLoc = new Location(argv[2]) ;
+        Location dstLoc = Location.create(argv[2]) ;
         String dstIndexName = argv[3] ;
         
         int readCacheSize = 0 ;

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java
index 90a6cfb..1ad2a6f 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/file/TestLocationLock.java
@@ -60,7 +60,7 @@ public class TestLocationLock {
 
     @Test
     public void location_lock_dir_01() {
-        Location dir = new Location(tempDir.getRoot().getAbsolutePath());
+        Location dir = Location.create(tempDir.getRoot().getAbsolutePath());
         LocationLock lock = dir.getLock();
         Assert.assertTrue(lock.canLock());
         Assert.assertFalse(lock.isLocked());
@@ -82,7 +82,7 @@ public class TestLocationLock {
     public void location_lock_dir_02() throws IOException {
         Assume.assumeTrue(negativePidsTreatedAsAlive);
 
-        Location dir = new Location(tempDir.getRoot().getAbsolutePath());
+        Location dir = Location.create(tempDir.getRoot().getAbsolutePath());
         LocationLock lock = dir.getLock();
         Assert.assertTrue(lock.canLock());
         Assert.assertFalse(lock.isLocked());
@@ -100,7 +100,7 @@ public class TestLocationLock {
 
     @Test
     public void location_lock_dir_03() {
-        Location dir = new Location(tempDir.getRoot().getAbsolutePath());
+        Location dir = Location.create(tempDir.getRoot().getAbsolutePath());
         LocationLock lock = dir.getLock();
         Assert.assertTrue(lock.canLock());
         Assert.assertFalse(lock.isLocked());
@@ -124,7 +124,7 @@ public class TestLocationLock {
     public void location_lock_dir_error_01() throws IOException {
         Assume.assumeTrue(negativePidsTreatedAsAlive);
 
-        Location dir = new Location(tempDir.getRoot().getAbsolutePath());
+        Location dir = Location.create(tempDir.getRoot().getAbsolutePath());
         LocationLock lock = dir.getLock();
         Assert.assertTrue(lock.canLock());
         Assert.assertFalse(lock.isLocked());
@@ -148,7 +148,7 @@ public class TestLocationLock {
     public void location_lock_dir_error_02() throws IOException {
         Assume.assumeTrue(negativePidsTreatedAsAlive);
 
-        Location dir = new Location(tempDir.getRoot().getAbsolutePath());
+        Location dir = Location.create(tempDir.getRoot().getAbsolutePath());
         LocationLock lock = dir.getLock();
         Assert.assertTrue(lock.canLock());
         Assert.assertFalse(lock.isLocked());
@@ -173,7 +173,7 @@ public class TestLocationLock {
     public void location_lock_dir_error_03() throws IOException {
         Assume.assumeTrue(negativePidsTreatedAsAlive);
         
-        Location dir = new Location(tempDir.getRoot().getAbsolutePath());
+        Location dir = Location.create(tempDir.getRoot().getAbsolutePath());
         LocationLock lock = dir.getLock();
         Assert.assertTrue(lock.canLock());
         Assert.assertFalse(lock.isLocked());

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/objectfile/TestStringFileDisk.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/objectfile/TestStringFileDisk.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/objectfile/TestStringFileDisk.java
index 9a984d1..cf9c1f7 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/objectfile/TestStringFileDisk.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/base/objectfile/TestStringFileDisk.java
@@ -35,7 +35,7 @@ public class TestStringFileDisk extends AbstractTestStringFile
     {
         String dir = ConfigTest.getTestingDir() ;
       clearDirectory(dir) ;
-      Location loc = new Location(dir) ;
+      Location loc = Location.create(dir) ;
       fn = loc.getPath("xyz", "node") ;
       FileOps.delete(fn) ;
       return FileFactory.createStringFileDisk(fn) ;

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_QuadsObjectIsNull.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_QuadsObjectIsNull.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_QuadsObjectIsNull.java
index d6d90d0..333caf1 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_QuadsObjectIsNull.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_QuadsObjectIsNull.java
@@ -41,7 +41,7 @@ public class T_QuadsObjectIsNull {
 //	}
 
 	static String DIR = "DBX" ;
-	static Location location = new Location(DIR) ;
+	static Location location = Location.create(DIR) ;
 
 	public static void main(String[] args) {
 

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TDBWriteTransaction.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TDBWriteTransaction.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TDBWriteTransaction.java
index c50127b..7a12e20 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TDBWriteTransaction.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TDBWriteTransaction.java
@@ -85,7 +85,7 @@ public class T_TDBWriteTransaction {
     {
         if ( false )
         {
-            Journal journal = Journal.create(new Location(location)) ;
+            Journal journal = Journal.create(Location.create(location)) ;
             JournalControl.print(journal) ;
             journal.close() ;
         }

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystem.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystem.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystem.java
index c7aefe0..1b459db 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystem.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystem.java
@@ -70,7 +70,7 @@ public class T_TransSystem
     static boolean MEM                  = true ;
     static String location              = true ? "/mnt/ssd1/tmp/DB163" : ConfigTest.getTestingDirDB() ;     // Using an SSD here is very helpful
     //static String location              = ConfigTest.getTestingDirDB() ;     // Using an SSD here is very helpful
-    static final Location LOC           = MEM ? Location.mem() : new Location(location) ;
+    static final Location LOC           = MEM ? Location.mem() : Location.create(location) ;
     
     static { 
         //SystemTDB.isWindows
@@ -416,7 +416,7 @@ public class T_TransSystem
         {
             FileOps.clearDirectory(LOC.getDirectoryPath()) ;
             // Clean because it's new.
-            //LOC = new Location(ConfigTest.getTestingDirUnique()) ;
+            //LOC = Location.create(ConfigTest.getTestingDirUnique()) ;
         }
     }
 
@@ -669,7 +669,7 @@ public class T_TransSystem
 
     private static int initCount = -1 ;
 
-    //static final Location LOC = new Location(ConfigTest.getTestingDirDB()) ;
+    //static final Location LOC = Location.create(ConfigTest.getTestingDirDB()) ;
     static final AtomicInteger gen = new AtomicInteger() ;
     
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystemMultiDatasets.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystemMultiDatasets.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystemMultiDatasets.java
index 90da56c..1acfc68 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystemMultiDatasets.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/extra/T_TransSystemMultiDatasets.java
@@ -77,7 +77,7 @@ public class T_TransSystemMultiDatasets
 
     private static int count_datasets = 0 ;
     static Location createLocation() {
-    	return MEM ? Location.mem() : new Location(ConfigTest.getTestingDirDB() + File.separator + "DB-" + ++count_datasets) ;
+    	return MEM ? Location.mem() : Location.create(ConfigTest.getTestingDirDB() + File.separator + "DB-" + ++count_datasets) ;
     }
 
     static final int Iterations             = MEM ? 1000 : 100 ;
@@ -548,7 +548,7 @@ public class T_TransSystemMultiDatasets
 
     private static int initCount = -1 ;
 
-    //static final Location LOC = new Location(ConfigTest.getTestingDirDB()) ;
+    //static final Location LOC = Location.create(ConfigTest.getTestingDirDB()) ;
     static final AtomicInteger gen = new AtomicInteger() ;
     
 }

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
index 0665f83..49302e2 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/graph/TestPrefixMappingTDB.java
@@ -91,7 +91,7 @@ public class TestPrefixMappingTDB extends AbstractTestPrefixMapping2
         String dir = ConfigTest.getTestingDir() ;
         FileOps.clearDirectory(dir) ;
 
-        DatasetPrefixesTDB prefixes = createTesting(new Location(dir), new DatasetControlMRSW()) ;
+        DatasetPrefixesTDB prefixes = createTesting(Location.create(dir), new DatasetControlMRSW()) ;
         PrefixMapping pmap1 = prefixes.getPrefixMapping() ;
 
         String x = pmap1.getNsPrefixURI("x") ;
@@ -105,13 +105,13 @@ public class TestPrefixMappingTDB extends AbstractTestPrefixMapping2
         String dir = ConfigTest.getTestingDir() ;
         FileOps.clearDirectory(dir) ;
 
-        DatasetPrefixesTDB prefixes = createTesting(new Location(dir), new DatasetControlMRSW()) ;
+        DatasetPrefixesTDB prefixes = createTesting(Location.create(dir), new DatasetControlMRSW()) ;
         PrefixMapping pmap1 = prefixes.getPrefixMapping() ;
 
         pmap1.setNsPrefix("x", "http://foo/") ;
         prefixes.close() ;
 
-        prefixes = createTesting(new Location(dir), new DatasetControlMRSW()) ;
+        prefixes = createTesting(Location.create(dir), new DatasetControlMRSW()) ;
         assertEquals("http://foo/", pmap1.getNsPrefixURI("x")) ;
         prefixes.close() ;
     }

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDBPersist.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDBPersist.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDBPersist.java
index 54a2e20..ef2a3e8 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDBPersist.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestDatasetTDBPersist.java
@@ -56,7 +56,7 @@ public class TestDatasetTDBPersist extends BaseTest
     {   
     	String dirname = ConfigTest.getCleanDir() ;
     	StoreConnection.reset() ;
-		graphLocation = new GraphLocation(new Location(dirname)) ;
+		graphLocation = new GraphLocation(Location.create(dirname)) ;
         graphLocation.createDataset() ;
     }
     

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestGraphTDB.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestGraphTDB.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestGraphTDB.java
index 8576d7f..5acba6f 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestGraphTDB.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/store/TestGraphTDB.java
@@ -39,7 +39,7 @@ public class TestGraphTDB extends AbstractTestGraph2
     @BeforeClass public static void beforeClass()
     {
         StoreConnection.reset() ;
-        graphLocation = new GraphLocation(new Location(ConfigTest.getCleanDir())) ;
+        graphLocation = new GraphLocation(Location.create(ConfigTest.getCleanDir())) ;
         graphLocation.release() ;
         graphLocation.clearDirectory() ;
         graphLocation.createGraph() ;

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java
index 6d450bd..5eadac8 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestNodeTableTransDisk.java
@@ -34,7 +34,7 @@ public class TestNodeTableTransDisk extends AbstractTestNodeTableTrans
     @Before public void before()
     {
     	String dir = ConfigTest.getCleanDir() ;
-    	loc = new Location(dir) ;
+    	loc = Location.create(dir) ;
     }
     
     @Override

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestObjectFileTransStorage.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestObjectFileTransStorage.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestObjectFileTransStorage.java
index caaedbd..fee0eaf 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestObjectFileTransStorage.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestObjectFileTransStorage.java
@@ -29,7 +29,7 @@ public class TestObjectFileTransStorage extends AbstractTestObjectFileTrans
     ObjectFile createFile(String basename)
     {
 //        String dir = ConfigTest.getTestingDir() ;
-//        Location loc = new Location(dir) ;
+//        Location loc = Location.create(dir) ;
 //        String fn = loc.getPath(basename) ;
 //        FileOps.deleteSilent(fn) ;
 //        BufferChannel chan = new BufferChannelFile(fn) ;
@@ -46,7 +46,7 @@ public class TestObjectFileTransStorage extends AbstractTestObjectFileTrans
     void deleteFile(String basename)
     {
 //        String dir = ConfigTest.getTestingDir() ;
-//        Location loc = new Location(dir) ;
+//        Location loc = Location.create(dir) ;
 //        String fn = loc.getPath(basename) ;
 //        FileOps.delete(fn) ;
     }

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
index 0bab155..0b0ed5b 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransRestart.java
@@ -59,7 +59,7 @@ public class TestTransRestart extends BaseTest {
     
     @Before public void setup() {
         path = ConfigTest.getCleanDir() ; 
-        location = new Location (path) ;
+        location = Location.create (path) ;
         if ( useTransactionsSetup )
             setupTxn() ;
         else

http://git-wip-us.apache.org/repos/asf/jena/blob/140a0889/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransactionTDB.java
----------------------------------------------------------------------
diff --git a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransactionTDB.java b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransactionTDB.java
index 6966dca..5c1193c 100644
--- a/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransactionTDB.java
+++ b/jena-tdb/src/test/java/com/hp/hpl/jena/tdb/transaction/TestTransactionTDB.java
@@ -45,7 +45,7 @@ public class TestTransactionTDB extends AbstractTestTransaction
     @Before public void before()
     {
         DIR = ConfigTest.getCleanDir() ;
-        StoreConnection.release(new Location(DIR)) ;
+        StoreConnection.release(Location.create(DIR)) ;
     }
     
     @After public void after()