Package org.geotools.data.shapefile.files

Examples of org.geotools.data.shapefile.files.ShpFiles.acquireRead()


    @Test
    public void testAcquireRead1() throws Throwable {
        ShpFiles shpFiles = new ShpFiles("http://somefile.com/shp.shp");

        URL url = shpFiles.acquireRead(DBF, this);
        assertEquals("http://somefile.com/shp.dbf", url.toExternalForm());
        assertEquals(1, shpFiles.numberOfLocks());
        FileWriter testWriter = new FileWriter() {

            public String id() {
View Full Code Here


    @Test
    public void testUnlockReadAssertion() throws Throwable {
        ShpFiles shpFiles = new ShpFiles("http://somefile.com/shp.shp");

        URL url = shpFiles.acquireRead(DBF, this);
        assertEquals("http://somefile.com/shp.dbf", url.toExternalForm());
        assertEquals(1, shpFiles.numberOfLocks());
        FileWriter testWriter = new FileWriter() {

            public String id() {
View Full Code Here

        }
       
        ShpFiles files = new ShpFiles(base+shp);
       
        BasicShpFileWriter requestor = new BasicShpFileWriter("testCaseURL");
        URL shpURL = files.acquireRead(SHP, requestor);
        URL dbfURL = files.acquireRead(DBF, requestor);
        URL shxURL = files.acquireRead(SHX, requestor);
        try{
            assertEquals(base+shp, shpURL.toExternalForm());
            assertEquals(base+dbf, dbfURL.toExternalForm());
View Full Code Here

       
        ShpFiles files = new ShpFiles(base+shp);
       
        BasicShpFileWriter requestor = new BasicShpFileWriter("testCaseURL");
        URL shpURL = files.acquireRead(SHP, requestor);
        URL dbfURL = files.acquireRead(DBF, requestor);
        URL shxURL = files.acquireRead(SHX, requestor);
        try{
            assertEquals(base+shp, shpURL.toExternalForm());
            assertEquals(base+dbf, dbfURL.toExternalForm());
            assertEquals(base+shx, shxURL.toExternalForm());
View Full Code Here

        ShpFiles files = new ShpFiles(base+shp);
       
        BasicShpFileWriter requestor = new BasicShpFileWriter("testCaseURL");
        URL shpURL = files.acquireRead(SHP, requestor);
        URL dbfURL = files.acquireRead(DBF, requestor);
        URL shxURL = files.acquireRead(SHX, requestor);
        try{
            assertEquals(base+shp, shpURL.toExternalForm());
            assertEquals(base+dbf, dbfURL.toExternalForm());
            assertEquals(base+shx, shxURL.toExternalForm());
        }finally{
View Full Code Here

        String fileName = files.get(SHP).getPath();
        fileName = fileName.substring(0, fileName.length()-4)+".shp";
        ShpFiles shpFiles = new ShpFiles(fileName);

        BasicShpFileWriter requestor = new BasicShpFileWriter("testCaseFile");
        URL shpURL = shpFiles.acquireRead(SHP, requestor);
        URL dbfURL = shpFiles.acquireRead(DBF, requestor);
        URL shxURL = shpFiles.acquireRead(SHX, requestor);
        try{
            assertEquals(files.get(SHP).toURI().toURL().toExternalForm(), shpURL.toExternalForm());
            assertEquals(files.get(DBF).toURI().toURL().toExternalForm(), dbfURL.toExternalForm());
View Full Code Here

        fileName = fileName.substring(0, fileName.length()-4)+".shp";
        ShpFiles shpFiles = new ShpFiles(fileName);

        BasicShpFileWriter requestor = new BasicShpFileWriter("testCaseFile");
        URL shpURL = shpFiles.acquireRead(SHP, requestor);
        URL dbfURL = shpFiles.acquireRead(DBF, requestor);
        URL shxURL = shpFiles.acquireRead(SHX, requestor);
        try{
            assertEquals(files.get(SHP).toURI().toURL().toExternalForm(), shpURL.toExternalForm());
            assertEquals(files.get(DBF).toURI().toURL().toExternalForm(), dbfURL.toExternalForm());
            assertEquals(files.get(SHX).toURI().toURL().toExternalForm(), shxURL.toExternalForm());
View Full Code Here

        ShpFiles shpFiles = new ShpFiles(fileName);

        BasicShpFileWriter requestor = new BasicShpFileWriter("testCaseFile");
        URL shpURL = shpFiles.acquireRead(SHP, requestor);
        URL dbfURL = shpFiles.acquireRead(DBF, requestor);
        URL shxURL = shpFiles.acquireRead(SHX, requestor);
        try{
            assertEquals(files.get(SHP).toURI().toURL().toExternalForm(), shpURL.toExternalForm());
            assertEquals(files.get(DBF).toURI().toURL().toExternalForm(), dbfURL.toExternalForm());
            assertEquals(files.get(SHX).toURI().toURL().toExternalForm(), shxURL.toExternalForm());
        }finally{
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.