hey Mike, is it possible you broke zip reloading on project opening with your commit? haven't downloaded it yet and am not sure i like the changes. many changes always equals a higher probability to break something. why couldn't you simply create the "missing" property directly before the file is read/written in ReaderWriterFileDataSource ?
i can have a go at it, but maybe you had a good reason to touch all these classes. ..ede On 06.10.2016 08:44, [email protected] wrote: > Revision: 5047 > http://sourceforge.net/p/jump-pilot/code/5047 > Author: michaudm > Date: 2016-10-06 06:44:39 +0000 (Thu, 06 Oct 2016) > Log Message: > ----------- > Use URI_KEY and FILE_KEY properties for file based datasources in order to > keep compatibility with legacy plugins > > Modified Paths: > -------------- > core/trunk/ChangeLog > core/trunk/src/com/vividsolutions/jump/io/CompressedFile.java > core/trunk/src/com/vividsolutions/jump/io/datasource/DataSource.java > > core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java > > core/trunk/src/com/vividsolutions/jump/workbench/datasource/FileDataSourceQueryChooser.java > > core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/OpenProjectPlugIn.java > core/trunk/src/jumptest/io/Playground.java > core/trunk/src/language/jump.properties > core/trunk/src/language/jump_cz.properties > core/trunk/src/language/jump_de.properties > core/trunk/src/language/jump_es.properties > core/trunk/src/language/jump_fi.properties > core/trunk/src/language/jump_fr.properties > core/trunk/src/language/jump_hu.properties > core/trunk/src/language/jump_it.properties > core/trunk/src/language/jump_ja_JP.properties > core/trunk/src/language/jump_ml.properties > core/trunk/src/language/jump_pt.properties > core/trunk/src/language/jump_pt_BR.properties > core/trunk/src/language/jump_ta_IN.properties > core/trunk/src/language/jump_te.properties > core/trunk/src/language/jump_zh_CN.properties > core/trunk/src/language/jump_zh_HK.properties > core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java > core/trunk/src/org/openjump/core/ui/io/file/DataSourceFileLayerLoader.java > > core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java > > core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java > > core/trunk/src/org/openjump/core/ui/plugin/layer/NewLayerPropertiesPlugIn.java > > core/trunk/src/org/openjump/core/ui/plugin/mousemenu/SaveDatasetsPlugIn.java > > Modified: core/trunk/ChangeLog > =================================================================== > --- core/trunk/ChangeLog 2016-10-05 14:15:10 UTC (rev 5046) > +++ core/trunk/ChangeLog 2016-10-06 06:44:39 UTC (rev 5047) > @@ -3,6 +3,10 @@ > # 2. make sure that lines break at 80 chars for constricted display > situations > #<-------------------------------- 80 chars > ----------------------------------># > > +2016-10-06 mmichaud <[email protected]> > + * Use URI_KEY and FILE_KEY properties for file based datasources > + in order to keep compatibility with legacy plugins > + > 2016-10-05 mmichaud <[email protected]> > * Fix #431 : Save project with unsaved layers > > > Modified: core/trunk/src/com/vividsolutions/jump/io/CompressedFile.java > =================================================================== > --- core/trunk/src/com/vividsolutions/jump/io/CompressedFile.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ core/trunk/src/com/vividsolutions/jump/io/CompressedFile.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -207,7 +207,7 @@ > > String extractMsg = compressedEntry != null ? " extract '" + > compressedEntry > + "'" : ""; > - Logger.debug("open '" + filePath + "'" + extractMsg); > + Logger.debug("Open '" + filePath + "'" + extractMsg); > > // check file accessibility beforehand > File file = new File(filePath); > > Modified: core/trunk/src/com/vividsolutions/jump/io/datasource/DataSource.java > =================================================================== > --- core/trunk/src/com/vividsolutions/jump/io/datasource/DataSource.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ core/trunk/src/com/vividsolutions/jump/io/datasource/DataSource.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -75,6 +75,7 @@ > /** > * Filename property, used for file-based DataSources > */ > + @Deprecated > public static final String FILE_KEY = "File"; > > /** > > Modified: > core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java > =================================================================== > --- > core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/com/vividsolutions/jump/io/datasource/ReaderWriterFileDataSource.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -31,6 +31,7 @@ > */ > package com.vividsolutions.jump.io.datasource; > > +import java.io.File; > import java.net.URI; > import java.util.ArrayList; > import java.util.Collection; > @@ -90,7 +91,7 @@ > .setTitle( > monitor, > I18N.getMessage( > - > "com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open-{0}", > + > "com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open", > createDescriptiveName(uri))); > } > > @@ -115,14 +116,21 @@ > > // make readers task monitor aware > DriverProperties dp = getWriterDriverProperties(); > - URI uri = new URI(dp.getProperty(DataSource.URI_KEY)); > + URI uri = null; > + if (dp.getProperty(DataSource.URI_KEY) != null) { > + uri = new URI(dp.getProperty(DataSource.URI_KEY)); > + } > + // for legacy plugins > + else if (dp.getProperty(DataSource.FILE_KEY) != null) { > + uri = new File(dp.getProperty(DataSource.FILE_KEY)).toURI(); > + } > if (writer instanceof TaskMonitorSupport) { > ((TaskMonitorSupport) writer).setTaskMonitor(monitor); > TaskMonitorUtil > .setTitle( > monitor, > I18N.getMessage( > - > "com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write-{0}", > + > "com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write", > createDescriptiveName(uri))); > } > > > Modified: > core/trunk/src/com/vividsolutions/jump/workbench/datasource/FileDataSourceQueryChooser.java > =================================================================== > --- > core/trunk/src/com/vividsolutions/jump/workbench/datasource/FileDataSourceQueryChooser.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/com/vividsolutions/jump/workbench/datasource/FileDataSourceQueryChooser.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -210,8 +210,8 @@ > > protected Map<?,?> toProperties(File file) { > HashMap<String,String> properties = new HashMap<>(); > + properties.put(DataSource.URI_KEY, file.toURI().toString()); > properties.put(DataSource.FILE_KEY, file.getPath()); > - properties.put(DataSource.URI_KEY, file.toURI().toString()); > properties.put(DataSource.COORDINATE_SYSTEM_KEY, > getFileChooserPanel().getSelectedCoordinateSystem().getName()); > > > Modified: > core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/OpenProjectPlugIn.java > =================================================================== > --- > core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/OpenProjectPlugIn.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/com/vividsolutions/jump/workbench/ui/plugin/OpenProjectPlugIn.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -237,7 +237,8 @@ > { > //set the new source for this layer > Map properties = > layer.getDataSourceQuery().getDataSource().getProperties(); > - properties.put(DataSource.FILE_KEY, filename); > + properties.put(DataSource.URI_KEY, new > File(filename).toURI().toString()); > + properties.put(DataSource.FILE_KEY, filename); > > layer.getDataSourceQuery().getDataSource().setProperties(properties); > > load(layer, registry, monitor); > } > > Modified: core/trunk/src/jumptest/io/Playground.java > =================================================================== > --- core/trunk/src/jumptest/io/Playground.java 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/jumptest/io/Playground.java 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -10,6 +10,7 @@ > import com.vividsolutions.jump.task.DummyTaskMonitor; > > > +import java.io.File; > import java.util.ArrayList; > import java.util.Collections; > import java.util.Iterator; > > Modified: core/trunk/src/language/jump.properties > =================================================================== > --- core/trunk/src/language/jump.properties 2016-10-05 14:15:10 UTC (rev > 5046) > +++ core/trunk/src/language/jump.properties 2016-10-06 06:44:39 UTC (rev > 5047) > @@ -22,12 +22,15 @@ > JUMPWorkbench.status.initialize-datasources = Initialize Datasources > JUMPWorkbench.status.show-workbench = Show Workbench > > + > > com.vividsolutions.jump.datastore.spatialdatabases.AbstractSpatialDatabasesDSExtension.datastore-disabled > = Datastore ''{0}'' disabled\: {1} > > com.vividsolutions.jump.datastore.spatialdatabases.AbstractSpatialDatabasesDSExtension.missing-dependency-jars > = Missing dependency jars {0} > > com.vividsolutions.jump.datastore.spatialdatabases.AbstractSpatialDatabasesDSExtension.there-were-errors > = There were errors\: {0} > > com.vividsolutions.jump.datastore.spatialdatabases.SpatialDatabasesDSConnection.unsupported-query-type > = Unsupported Query Type > > com.vividsolutions.jump.datastore.spatialdatabases.SpatialDatabasesDSConnection.resultset-must-have-a-geometry-column > = Result Set Must Have a Geometry Column > > com.vividsolutions.jump.datastore.spatialdatabases.SpatialDatabasesDSConnection.SQL-error > = SQL error\: > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open = Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write = > Write {0} > com.vividsolutions.jump.io.ShapefileReader.shp-gt-dbf = Error reading > shapefile ''{0}'' \:\n\ > \ number of records in shp ({1}) > number of records in dbf ({2}). > com.vividsolutions.jump.io.ShapefileReader.shp-lt-dbf = Error reading > shapefile ''{0}'' \:\n\ > > Modified: core/trunk/src/language/jump_cz.properties > =================================================================== > --- core/trunk/src/language/jump_cz.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_cz.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2710,4 +2710,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_de.properties > =================================================================== > --- core/trunk/src/language/jump_de.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_de.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2706,4 +2706,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_es.properties > =================================================================== > --- core/trunk/src/language/jump_es.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_es.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2689,4 +2689,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_fi.properties > =================================================================== > --- core/trunk/src/language/jump_fi.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_fi.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2683,4 +2683,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_fr.properties > =================================================================== > --- core/trunk/src/language/jump_fr.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_fr.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2713,4 +2713,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=Ecrire > des geometries avec Z > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=Cl\xE9 > primaire > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=Ouvrir > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=Enregistrer > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_hu.properties > =================================================================== > --- core/trunk/src/language/jump_hu.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_hu.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2706,4 +2706,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_it.properties > =================================================================== > --- core/trunk/src/language/jump_it.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_it.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2690,3 +2690,5 @@ > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=Chiave > primaria > ui.EditOptionsPanel.select-geometry=Seleziona la geometria dopo che \xE8 > stata disegnata > ui.EditOptionsPanel.select-geometry-warning=Attenzione: questa opzione > diseleziona geometrie selezionate precedentemente > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > > Modified: core/trunk/src/language/jump_ja_JP.properties > =================================================================== > --- core/trunk/src/language/jump_ja_JP.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_ja_JP.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2708,4 +2708,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_ml.properties > =================================================================== > --- core/trunk/src/language/jump_ml.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_ml.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -3979,4 +3979,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_pt.properties > =================================================================== > --- core/trunk/src/language/jump_pt.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_pt.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2704,4 +2704,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_pt_BR.properties > =================================================================== > --- core/trunk/src/language/jump_pt_BR.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_pt_BR.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2705,4 +2705,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_ta_IN.properties > =================================================================== > --- core/trunk/src/language/jump_ta_IN.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_ta_IN.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2707,4 +2707,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_te.properties > =================================================================== > --- core/trunk/src/language/jump_te.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_te.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -3213,4 +3213,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_zh_CN.properties > =================================================================== > --- core/trunk/src/language/jump_zh_CN.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_zh_CN.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2868,4 +2868,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/language/jump_zh_HK.properties > =================================================================== > --- core/trunk/src/language/jump_zh_HK.properties 2016-10-05 14:15:10 UTC > (rev 5046) > +++ core/trunk/src/language/jump_zh_HK.properties 2016-10-06 06:44:39 UTC > (rev 5047) > @@ -2869,4 +2869,6 @@ > > org.openjump.core.ui.plugin.datastore.DataStoreSaveDriverPanel.write-3d-geometries=#T:Write > 3D geometries > > org.openjump.core.ui.plugin.datastore.postgis2.PostGISSaveDriverPanel.primary-key=#T:Primary > Key > ui.EditOptionsPanel.select-geometry=#T:Select the geometry after it has been > drawn > -ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > \ No newline at end of file > +ui.EditOptionsPanel.select-geometry-warning=#T:Warning: this option > deselects previous geometries selection > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.open=#T:Open > {0} > +com.vividsolutions.jump.io.datasource.ReaderWriterFileDataSource.write=#T:Write > {0} > \ No newline at end of file > > Modified: core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java > =================================================================== > --- core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ core/trunk/src/org/openjump/core/ccordsys/utils/ProjUtils.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -18,8 +18,10 @@ > > import java.io.File; > import java.io.IOException; > +import java.net.URI; > import java.net.URISyntaxException; > import java.util.Iterator; > +import java.util.Map; > import java.util.Scanner; > > /** > @@ -301,9 +303,14 @@ > else { > if (!isDataBaseLayer(layer)) { > DataSourceQuery dsq = layer.getDataSourceQuery(); > - Object fnameObj = > dsq.getDataSource().getProperties().get(DataSource.FILE_KEY); > - fileSourcePath = fnameObj.toString(); > - srsInfo = getSRSInfoFromAuxiliaryFile(fileSourcePath); > + Map properties = dsq.getDataSource().getProperties(); > + if (properties.get(DataSource.URI_KEY) != null) { > + fileSourcePath = new > URI(properties.get(DataSource.URI_KEY).toString()).getPath(); > + srsInfo = getSRSInfoFromAuxiliaryFile(fileSourcePath); > + } else if (properties.get(DataSource.FILE_KEY) != null) { > + fileSourcePath = > properties.get(DataSource.FILE_KEY).toString(); > + srsInfo = getSRSInfoFromAuxiliaryFile(fileSourcePath); > + } > } > } > return srsInfo; > > Modified: > core/trunk/src/org/openjump/core/ui/io/file/DataSourceFileLayerLoader.java > =================================================================== > --- > core/trunk/src/org/openjump/core/ui/io/file/DataSourceFileLayerLoader.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/org/openjump/core/ui/io/file/DataSourceFileLayerLoader.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -27,6 +27,7 @@ > package org.openjump.core.ui.io.file; > > import java.io.File; > +import java.net.MalformedURLException; > import java.net.URI; > import java.net.URISyntaxException; > import java.util.ArrayList; > @@ -396,6 +397,7 @@ > file = new File(uri); > } > String filePath = file.getAbsolutePath(); > + properties.put(DataSource.URI_KEY, uri.toString()); > properties.put(DataSource.FILE_KEY, filePath); > properties.putAll(options); > return properties; > > Modified: > core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java > =================================================================== > --- > core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/org/openjump/core/ui/plugin/file/SaveLayersWithoutDataSourcePlugIn.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -166,8 +166,8 @@ > String path = new File(dir, fileName.getName()).getAbsolutePath(); > > DriverProperties dp = new DriverProperties(); > - dp.set("File", path); > - dp.set(DataSource.URI_KEY, new > File(path).toURI().toURL().toExternalForm()); > + dp.set(DataSource.URI_KEY, new File(path).toURI().toString()); > + dp.set(DataSource.FILE_KEY, path); > dataSource.setProperties(dp); > > DataSourceQuery dsq = new DataSourceQuery(dataSource, path, path); > > Modified: > core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java > =================================================================== > --- > core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/org/openjump/core/ui/plugin/file/open/OpenProjectWizard.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -35,6 +35,8 @@ > import java.awt.*; > import java.awt.geom.NoninvertibleTransformException; > import java.io.*; > +import java.net.MalformedURLException; > +import java.net.URI; > import java.util.ArrayList; > import java.util.Collections; > import java.util.List; > @@ -299,11 +301,18 @@ > DataSourceQuery dataSourceQuery = > layer.getDataSourceQuery(); > DataSource dataSource = > dataSourceQuery.getDataSource(); > Map properties = dataSource.getProperties(); > - String fname = > properties.get(DataSource.FILE_KEY).toString(); > + String fname = null; > + if (properties.get(DataSource.URI_KEY) != null > && properties.get(DataSource.URI_KEY).toString().length()>0) { > + fname = new > URI(properties.get(DataSource.URI_KEY).toString()).getPath(); > + } > + //if (fname == null) { > + // fname = > properties.get(DataSource.FILE_KEY).toString(); > + //} > String filename = findFile.getFileName(fname); > if (filename.length() > 0) { > // set the new source for this layer > - properties.put(DataSource.FILE_KEY, > filename); > + //properties.put(DataSource.FILE_KEY, > filename); > + properties.put(DataSource.URI_KEY, new > File(filename).toURI().toString()); > dataSource.setProperties(properties); > load(layer, registry, monitor); > } else { > @@ -424,14 +433,16 @@ > return false; > } > > - private File getLayerFileProperty(Layer layer) { > + private File getLayerFileProperty(Layer layer) throws > MalformedURLException { > DataSourceQuery dataSourceQuery = layer.getDataSourceQuery(); > DataSource dataSource = dataSourceQuery.getDataSource(); > Map properties = dataSource.getProperties(); > - Object property = properties.get(DataSource.FILE_KEY); > - if(property == null || property.toString().equals("")) > - return null; > - File layerFile = new File(property.toString()); > + File layerFile = null; > + if (properties.get(DataSource.URI_KEY) != null && > properties.get(DataSource.URI_KEY).toString().length() > 0) { > + layerFile = new > File(URI.create(properties.get(DataSource.URI_KEY).toString()).toURL().toExternalForm()); > + } else if (properties.get(DataSource.FILE_KEY) != null && > properties.get(DataSource.FILE_KEY).toString().length() > 0) { > + layerFile = new > File(properties.get(DataSource.FILE_KEY).toString()); > + } > return layerFile; > } > > @@ -439,6 +450,7 @@ > DataSourceQuery dataSourceQuery = layer.getDataSourceQuery(); > DataSource dataSource = dataSourceQuery.getDataSource(); > Map properties = dataSource.getProperties(); > + properties.put(DataSource.URI_KEY, file.toURI().toString()); > properties.put(DataSource.FILE_KEY, file.getAbsolutePath()); > } > > > Modified: > core/trunk/src/org/openjump/core/ui/plugin/layer/NewLayerPropertiesPlugIn.java > =================================================================== > --- > core/trunk/src/org/openjump/core/ui/plugin/layer/NewLayerPropertiesPlugIn.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/org/openjump/core/ui/plugin/layer/NewLayerPropertiesPlugIn.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -37,6 +37,8 @@ > import java.awt.event.ActionListener; > import java.io.File; > import java.io.IOException; > +import java.net.URI; > +import java.net.URISyntaxException; > import java.nio.charset.Charset; > import java.text.DecimalFormat; > import java.text.NumberFormat; > @@ -440,8 +442,7 @@ > info = info > + property(SOURCE_PATH, label_Path_R, > bgColor1); > // Add charset if selected vector layer is a > shapefile > - if ((layers.length == 1) > - && (layers[0].getDataSourceQuery() != null)) > { > + if (layers[0].getDataSourceQuery() != null) { > if (layers[0] > .getDataSourceQuery() > .getDataSource() > @@ -460,8 +461,7 @@ > info = info + header("", COORDINATE_SYSTEM); > setInfoProjection(layers); > info = info + property(CRS, label_Coordinate, bgColor0); > - info = info > - + property(SOURCE_PATH, label_Coordinate_file, > bgColor1); > + info = info + property(SOURCE_PATH, label_Coordinate_file, > bgColor1); > } > // if more than one layer.class is selected > else { > @@ -526,7 +526,7 @@ > } > > // Set Info layer (excluded projection) > - private void setInfo(Layer[] layers) throws IOException { > + private void setInfo(Layer[] layers) throws IOException, > URISyntaxException { > if (layers.length == 1) { > // If only one layer is selected > if (layers[0].getName().startsWith("wfs")) { > @@ -568,7 +568,7 @@ > } > String geoClassName = geo.getClass().getName(); > int count = geometryModes.get(geoClassName) == null > ? 0 > - : ((Integer) geometryModes.get(geoClassName)) > + : (geometryModes.get(geoClassName)) > .intValue(); > geometryModes.put(new String(geoClassName), > new Integer(count + 1)); > @@ -576,22 +576,20 @@ > } > DataSourceQuery dsq = layers[l].getDataSourceQuery(); > if (dsq != null) { > - String dsqSourceClass = dsq.getDataSource().getClass() > - .getName(); > + String dsqSourceClass = > dsq.getDataSource().getClass().getName(); > if (sourceClass.equals("")) { > sourceClass = dsqSourceClass; > } else if (!sourceClass.equals(dsqSourceClass)) { > multipleSourceTypes = true; > } > - Object fnameObj = dsq.getDataSource().getProperties() > - .get(DataSource.FILE_KEY); > - if (fnameObj == null) { > - fnameObj = dsq.getDataSource().getProperties() > - > .get(DataStoreQueryDataSource.CONNECTION_DESCRIPTOR_KEY); > + Map properties = dsq.getDataSource().getProperties(); > + if (properties.get(DataSource.URI_KEY) != null) { > + sourcePath = new > URI(properties.get(DataSource.URI_KEY).toString()).getPath(); > + } else if (properties.get(DataSource.FILE_KEY) != null) { > + sourcePath = > properties.get(DataSource.FILE_KEY).toString(); > + } else if > (properties.get(DataStoreQueryDataSource.CONNECTION_DESCRIPTOR_KEY) != null) { > + sourcePath = > properties.get(DataStoreQueryDataSource.CONNECTION_DESCRIPTOR_KEY).toString(); > } > - if (fnameObj != null) { > - sourcePath = fnameObj.toString(); > - } > } > } > if (numFeatures == 0) { > > Modified: > core/trunk/src/org/openjump/core/ui/plugin/mousemenu/SaveDatasetsPlugIn.java > =================================================================== > --- > core/trunk/src/org/openjump/core/ui/plugin/mousemenu/SaveDatasetsPlugIn.java > 2016-10-05 14:15:10 UTC (rev 5046) > +++ > core/trunk/src/org/openjump/core/ui/plugin/mousemenu/SaveDatasetsPlugIn.java > 2016-10-06 06:44:39 UTC (rev 5047) > @@ -627,8 +627,9 @@ > String newFileName = path + newLayer.getName() + ".shp"; > HashMap properties = new HashMap(); > properties.put(DataSource.COORDINATE_SYSTEM_KEY, "Unspecified"); > + properties.put(DataSource.URI_KEY, new > File(newFileName).toURI().toString()); > properties.put(DataSource.FILE_KEY, newFileName); > - DataSource dataSource = (DataSource) > StandardReaderWriterFileDataSource.Shapefile.class > + DataSource dataSource = > StandardReaderWriterFileDataSource.Shapefile.class > .newInstance(); > dataSource.setProperties(properties); > DataSourceQuery dataSourceQuery = new DataSourceQuery(dataSource, > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Jump-pilot-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Jump-pilot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
