Fixed shp extension

This commit is contained in:
Fabio Sinibaldi 2021-01-14 12:58:01 +01:00
parent 4036900221
commit 0552365f31
3 changed files with 25 additions and 18 deletions

View File

@ -164,7 +164,7 @@ public class SDIManager {
createWorkspace(workspace);
log.debug("Publishing remote folder "+remoteFolder);
URL directoryPath=new URL("file:"+remoteFolder+"/"+completeFileName);
URL directoryPath=new URL("file:"+remoteFolder+"/"+filename+".shp");
//TODO Evaluate SRS

View File

@ -1,33 +1,38 @@
package org.gcube.application.geoportal;
import java.io.File;
import java.net.MalformedURLException;
import java.util.Collections;
import org.gcube.application.geoportal.utils.Files;
import org.geotoolkit.data.DataStore;
import org.geotoolkit.data.DataStoreFactory;
import org.geotoolkit.data.DataStoreFinder;
import org.geotoolkit.storage.DataStoreException;
public class ShapeFilesTest {
public static void main(String[] args) throws MalformedURLException, DataStoreException {
// File shp=Files.getFileFromResources("concessioni/pos.shp");
// System.out.println("File "+shp.getAbsolutePath()+" : "+shp.getTotalSpace()+"b");
//// DataStoreFinder.scanForPlugins();
// System.out.println("Factories are");
// DataStoreFinder.getAllFactories(null).forEach((DataStoreFactory f)->{
// System.out.println(f.getDisplayName()+"\t"+f.getDescription());
// });
// System.out.println();
// DataStore inputDataStore = DataStoreFinder.open(
// Collections.singletonMap("url", shp.toURI().toURL()));
//
// System.out.println("Datastore is "+inputDataStore);
//
//
// System.out.println(inputDataStore.getTypeNames());
File shp=Files.getFileFromResources("concessioni/pos.shp");
System.out.println("File "+shp.getAbsolutePath()+" : "+shp.getTotalSpace()+"b");
// DataStoreFinder.scanForPlugins();
System.out.println("Factories are");
DataStoreFinder.getAllFactories(null).forEach((DataStoreFactory f)->{
System.out.println(f.getDisplayName()+"\t"+f.getDescription());
});
System.out.println();
DataStore inputDataStore = DataStoreFinder.open(
Collections.singletonMap("url", shp.toURI().toURL()));
System.out.println("Datastore is "+inputDataStore);
String filename="some Une+* / \\ []() l:];kaj.sd\"sfl.blah";
System.out.println(Files.fixFilename(filename));
System.out.println(inputDataStore.getTypeNames());
// String filename="some Une+* / \\ []() l:];kaj.sd\"sfl.blah";
// System.out.println(Files.fixFilename(filename));
}

View File

@ -67,6 +67,8 @@ public class TestModel {
RelazioneScavo relScavo=new RelazioneScavo();
relScavo.setAbstractSection("simple abstract section");
relScavo.setAbstractEng("simple abstract section ENG ");
relScavo.setAbstractIta("semplice abstract ITA ");
relScavo.setResponsabili(concessione.getAuthors());
concessione.setRelazioneScavo(relScavo);