sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1817597 [16/19] - in /sis/branches/ISO-19115-3: ./ application/ application/sis-console/ application/sis-console/src/main/artifact/ application/sis-console/src/main/artifact/lib/ application/sis-console/src/main/artifact/lib/darwin/ applic...
Date Sat, 09 Dec 2017 10:57:47 GMT
Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/TestCase.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -27,6 +27,7 @@ import org.apache.sis.storage.DataStoreE
 import org.apache.sis.util.logging.EmptyWarningListeners;
 import org.apache.sis.internal.netcdf.ucar.DecoderWrapper;
 import org.apache.sis.internal.system.Modules;
+import org.apache.sis.setup.GeometryLibrary;
 import org.opengis.wrapper.netcdf.IOTestCase;
 import ucar.nc2.dataset.NetcdfDataset;
 import org.junit.AfterClass;
@@ -35,7 +36,7 @@ import static org.junit.Assert.*;
 
 
 /**
- * Base class of NetCDF tests. Subclasses shall override the {@link #createDecoder(String)}.
+ * Base class of netCDF tests. Subclasses shall override the {@link #createDecoder(String)}.
  *
  * <p>This class is <strong>not</strong> thread safe - do not run subclasses in parallel.</p>
  *
@@ -76,7 +77,7 @@ public abstract strictfp class TestCase
     /**
      * Returns {@code true} if the given supplemental formats (THREDDS, HDF5) is supported.
      * The default implementation returns {@code true} since the UCAR library supports all
-     * supplemental formats tested in this suite. Subclasses working only with the NetCDF
+     * supplemental formats tested in this suite. Subclasses working only with the netCDF
      * classic or 64-bits format can unconditionally returns {@code false}.
      *
      * @param  format  either {@code "THREDDS"} or {@code "HDF5"}.
@@ -92,9 +93,9 @@ public abstract strictfp class TestCase
      *
      * <ul>
      *   <li>{@link #THREDDS} for a NcML file.</li>
-     *   <li>{@link #NCEP}    for a NetCDF binary file.</li>
-     *   <li>{@link #CIP}     for a NetCDF binary file.</li>
-     *   <li>{@link #LANDSAT} for a NetCDF binary file.</li>
+     *   <li>{@link #NCEP}    for a netCDF binary file.</li>
+     *   <li>{@link #CIP}     for a netCDF binary file.</li>
+     *   <li>{@link #LANDSAT} for a netCDF binary file.</li>
      * </ul>
      *
      * The default implementation first delegates to {@link #open(String)}, then wraps the result
@@ -108,7 +109,7 @@ public abstract strictfp class TestCase
      * @throws DataStoreException if a logical error occurred.
      */
     protected Decoder createDecoder(final String name) throws IOException, DataStoreException {
-        return new DecoderWrapper(LISTENERS, new NetcdfDataset(open(name)));
+        return new DecoderWrapper(new NetcdfDataset(open(name)), GeometryLibrary.JAVA2D, LISTENERS);
     }
 
     /**
@@ -139,7 +140,7 @@ public abstract strictfp class TestCase
 
     /**
      * Invoked after all tests in a class have been executed.
-     * This method closes all NetCDF files.
+     * This method closes all netCDF files.
      *
      * @throws IOException if an error occurred while closing a file.
      */
@@ -187,7 +188,7 @@ public abstract strictfp class TestCase
      *
      * @param  expected       the expected attribute value.
      * @param  attributeName  the name of the attribute to test.
-     * @throws IOException if an error occurred while reading the NetCDF file.
+     * @throws IOException if an error occurred while reading the netCDF file.
      */
     protected final void assertAttributeEquals(final String expected, final String attributeName) throws IOException {
         assertEquals(attributeName, expected, decoder.stringValue(attributeName));
@@ -199,7 +200,7 @@ public abstract strictfp class TestCase
      *
      * @param  expected       the expected attribute value.
      * @param  attributeName  the name of the attribute to test.
-     * @throws IOException if an error occurred while reading the NetCDF file.
+     * @throws IOException if an error occurred while reading the netCDF file.
      */
     protected final void assertAttributeEquals(final Number expected, final String attributeName) throws IOException {
         assertEquals(attributeName, expected, decoder.numericValue(attributeName));
@@ -211,7 +212,7 @@ public abstract strictfp class TestCase
      *
      * @param  expected       the expected attribute value.
      * @param  attributeName  the name of the attribute to test.
-     * @throws IOException if an error occurred while reading the NetCDF file.
+     * @throws IOException if an error occurred while reading the netCDF file.
      */
     protected final void assertAttributeEquals(final Date expected, final String attributeName) throws IOException {
         assertEquals(attributeName, expected, decoder.dateValue(attributeName));

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/VariableTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -164,7 +164,7 @@ public strictfp class VariableTest exten
     /**
      * Tests {@link Variable#read()} on a one-dimensional variable.
      *
-     * @throws IOException if an error occurred while reading the NetCDF file.
+     * @throws IOException if an error occurred while reading the netCDF file.
      * @throws DataStoreException if a logical error occurred.
      */
     @Test

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -25,6 +25,7 @@ import org.apache.sis.internal.netcdf.De
 import org.apache.sis.internal.netcdf.DecoderTest;
 import org.apache.sis.internal.storage.io.ChannelDataInput;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.test.DependsOn;
 
 import static org.junit.Assert.*;
@@ -60,9 +61,9 @@ public final strictfp class ChannelDecod
      *
      * <ul>
      *   <li>{@link #THREDDS} for a NcML file.</li>
-     *   <li>{@link #NCEP}    for a NetCDF binary file.</li>
-     *   <li>{@link #CIP}     for a NetCDF binary file.</li>
-     *   <li>{@link #LANDSAT} for a NetCDF binary file.</li>
+     *   <li>{@link #NCEP}    for a netCDF binary file.</li>
+     *   <li>{@link #CIP}     for a netCDF binary file.</li>
+     *   <li>{@link #LANDSAT} for a netCDF binary file.</li>
      * </ul>
      *
      * @param  name  the file name as one of the above-cited constants.
@@ -75,12 +76,12 @@ public final strictfp class ChannelDecod
         assertNotNull(name, in);
         final ChannelDataInput input = new ChannelDataInput(name,
                 Channels.newChannel(in), ByteBuffer.allocate(4096), false);
-        return new ChannelDecoder(LISTENERS, input);
+        return new ChannelDecoder(input, null, GeometryLibrary.JAVA2D, LISTENERS);
     }
 
     /**
      * Unconditionally returns {@code false} since {@link ChannelDecoder}
-     * supports only the classic and 64 bits NetCDF formats.
+     * supports only the classic and 64 bits netCDF formats.
      *
      * @return {@code false}.
      */

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -51,7 +51,7 @@ public final strictfp class GridGeometry
 
     /**
      * Unconditionally returns {@code false} since {@link ChannelDecoder}
-     * supports only the classic and 64 bits NetCDF formats.
+     * supports only the classic and 64 bits netCDF formats.
      *
      * @return {@code false}.
      */

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -52,7 +52,7 @@ public final strictfp class VariableInfo
 
     /**
      * Unconditionally returns {@code false} since {@link ChannelDecoder}
-     * supports only the classic and 64 bits NetCDF formats.
+     * supports only the classic and 64 bits netCDF formats.
      *
      * @return {@code false}.
      */

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/ConformanceTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -31,6 +31,7 @@ import org.apache.sis.internal.netcdf.De
 import org.apache.sis.internal.netcdf.ucar.DecoderWrapper;
 import org.apache.sis.internal.netcdf.TestCase;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestUtilities;
 import org.junit.Test;
@@ -43,7 +44,7 @@ import static org.junit.Assert.*;
  * The tests are overridden in order to add some additional assertions for attributes not parsed by
  * the GeoAPI demo code.
  *
- * <p>This tests uses the UCAR implementation for reading NetCDF attributes.
+ * <p>This tests uses the UCAR implementation for reading netCDF attributes.
  * For a test using the SIS embedded implementation, see {@link MetadataReaderTest}.</p>
  *
  * @author  Martin Desruisseaux (Geomatys)
@@ -54,7 +55,7 @@ import static org.junit.Assert.*;
 @DependsOn(MetadataReaderTest.class)
 public final strictfp class ConformanceTest extends NetcdfMetadataTest {
     /**
-     * Reads a metadata object from the given NetCDF file.
+     * Reads a metadata object from the given netCDF file.
      * This method is invoked by the tests inherited from the {@code geoapi-test} module.
      *
      * <div class="note"><b>Note:</b>
@@ -62,13 +63,13 @@ public final strictfp class ConformanceT
      * {@code NetcdfFile.findAttribute(String)} method calls. However in SIS implementation, the metadata
      * object is fully created right at this method invocation time.</div>
      *
-     * @param  file the NetCDF file to wrap.
+     * @param  file  the netCDF file to wrap.
      * @return a metadata implementation created from the attributes found in the given file.
-     * @throws IOException if an error occurred while reading the given NetCDF file.
+     * @throws IOException if an error occurred while reading the given netCDF file.
      */
     @Override
     protected Metadata wrap(final NetcdfFile file) throws IOException {
-        final Decoder decoder = new DecoderWrapper(TestCase.LISTENERS, file);
+        final Decoder decoder = new DecoderWrapper(file, GeometryLibrary.JAVA2D, TestCase.LISTENERS);
         final MetadataReader ncISO = new MetadataReader(decoder);
         try {
             return ncISO.read();
@@ -139,7 +140,7 @@ public final strictfp class ConformanceT
     }
 
     /**
-     * Tests a NetCDF binary file. This method inherits the tests defined in GeoAPI,
+     * Tests a netCDF binary file. This method inherits the tests defined in GeoAPI,
      * and adds some additional tests for attributes parsed by SIS but not GeoAPI.
      *
      * @throws IOException if the test file can not be read.
@@ -175,7 +176,10 @@ public final strictfp class ConformanceT
     @Test
     @Override
     public void testLandsat() throws IOException {
-        addCommonProperties(expectedProperties, false);
+        final Map<String,Object> expected = expectedProperties;
+        addCommonProperties(expected, false);
+        assertNull(expected.put("identificationInfo.citation.title", "Landsat-GDAL"));
+        assertNull(expected.put("metadataIdentifier.code", "Landsat-GDAL"));
         super.testLandsat();
         assertSame("metadataScope", ScopeCode.DATASET, getSingleton(metadata.getMetadataScopes()).getResourceScope());
 
@@ -193,6 +197,8 @@ public final strictfp class ConformanceT
     public void testCIP() throws IOException {
         final Map<String,Object> expected = expectedProperties;
         addCommonProperties(expected, true);
+        assertNull(expected.put("identificationInfo.citation.title", "CIP"));
+        assertNull(expected.put("metadataIdentifier.code", "CIP"));
         super.testCIP();
         assertSame("metadataScope", ScopeCode.DATASET, getSingleton(metadata.getMetadataScopes()).getResourceScope());
         /*

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/MetadataReaderTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -26,6 +26,7 @@ import org.apache.sis.internal.netcdf.uc
 import org.apache.sis.internal.netcdf.impl.ChannelDecoderTest;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.setup.GeometryLibrary;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
@@ -35,7 +36,7 @@ import static org.apache.sis.test.TestUt
 
 /**
  * Tests {@link MetadataReader}. This tests uses the SIS embedded implementation and the UCAR library
- * for reading NetCDF attributes.
+ * for reading netCDF attributes.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.8
@@ -57,7 +58,7 @@ public final strictfp class MetadataRead
     }
 
     /**
-     * Reads the metadata using the NetCDF decoder embedded with SIS,
+     * Reads the metadata using the netCDF decoder embedded with SIS,
      * and compares its string representation with the expected one.
      *
      * @throws IOException if an I/O error occurred while opening the file.
@@ -82,7 +83,7 @@ public final strictfp class MetadataRead
     @Test
     public void testUCAR() throws IOException, DataStoreException {
         final Metadata metadata;
-        try (Decoder input = new DecoderWrapper(TestCase.LISTENERS, new NetcdfDataset(open(NCEP)))) {
+        try (Decoder input = new DecoderWrapper(new NetcdfDataset(open(NCEP)), GeometryLibrary.JAVA2D, TestCase.LISTENERS)) {
             metadata = new MetadataReader(input).read();
         }
         compareToExpected(metadata);

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreProviderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreProviderTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreProviderTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreProviderTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -48,7 +48,7 @@ import static org.opengis.test.Assert.*;
 public final strictfp class NetcdfStoreProviderTest extends IOTestCase {
     /**
      * Tests {@link NetcdfStoreProvider#probeContent(StorageConnector)} for an input stream which shall
-     * be recognized as a classic NetCDF file.
+     * be recognized as a classic netCDF file.
      *
      * @throws DataStoreException if a logical error occurred.
      */
@@ -66,7 +66,7 @@ public final strictfp class NetcdfStoreP
     /**
      * Tests {@link NetcdfStoreProvider#probeContent(StorageConnector)} for a UCAR {@link NetcdfFile} object.
      *
-     * @throws IOException if an error occurred while opening the NetCDF file.
+     * @throws IOException if an error occurred while opening the netCDF file.
      * @throws DataStoreException if a logical error occurred.
      */
     @Test
@@ -83,9 +83,9 @@ public final strictfp class NetcdfStoreP
 
     /**
      * Tests {@link NetcdfStoreProvider#decoder(WarningListeners, StorageConnector)} for an input stream which
-     * shall be recognized as a classic NetCDF file. The provider shall instantiate a {@link ChannelDecoder}.
+     * shall be recognized as a classic netCDF file. The provider shall instantiate a {@link ChannelDecoder}.
      *
-     * @throws IOException if an error occurred while opening the NetCDF file.
+     * @throws IOException if an error occurred while opening the netCDF file.
      * @throws DataStoreException if a logical error occurred.
      */
     @Test
@@ -100,7 +100,7 @@ public final strictfp class NetcdfStoreP
      * Tests {@link NetcdfStoreProvider#decoder(WarningListeners, StorageConnector)} for a UCAR
      * {@link NetcdfFile} object. The provider shall instantiate a {@link DecoderWrapper}.
      *
-     * @throws IOException if an error occurred while opening the NetCDF file.
+     * @throws IOException if an error occurred while opening the netCDF file.
      * @throws DataStoreException if a logical error occurred.
      */
     @Test

Modified: sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreTest.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreTest.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-netcdf/src/test/java/org/apache/sis/storage/netcdf/NetcdfStoreTest.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -41,10 +41,10 @@ import static org.opengis.test.Assert.*;
 })
 public final strictfp class NetcdfStoreTest extends IOTestCase {
     /**
-     * Returns a new NetCDF store to test.
+     * Returns a new netCDF store to test.
      *
      * @param  dataset the name of the datastore to load.
-     * @throws DataStoreException if an error occurred while reading the NetCDF file.
+     * @throws DataStoreException if an error occurred while reading the netCDF file.
      */
     private static NetcdfStore create(final String dataset) throws DataStoreException {
         return new NetcdfStore(null, new StorageConnector(IOTestCase.class.getResource(dataset)));
@@ -53,7 +53,7 @@ public final strictfp class NetcdfStoreT
     /**
      * Tests {@link NetcdfStore#getMetadata()}.
      *
-     * @throws DataStoreException if an error occurred while reading the NetCDF file.
+     * @throws DataStoreException if an error occurred while reading the netCDF file.
      */
     @Test
     public void testGetMetadata() throws DataStoreException {
@@ -68,7 +68,7 @@ public final strictfp class NetcdfStoreT
     /**
      * Tests {@link NetcdfStore#getConventionVersion()}.
      *
-     * @throws DataStoreException if an error occurred while reading the NetCDF file.
+     * @throws DataStoreException if an error occurred while reading the netCDF file.
      */
     @Test
     public void testGetConventionVersion() throws DataStoreException {

Modified: sis/branches/ISO-19115-3/storage/sis-shapefile/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-shapefile/pom.xml?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-shapefile/pom.xml (original)
+++ sis/branches/ISO-19115-3/storage/sis-shapefile/pom.xml Sat Dec  9 10:57:44 2017
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>storage</artifactId>
-    <version>0.8-jdk8-SNAPSHOT</version>
+    <version>1.0-jdk8-SNAPSHOT</version>
   </parent>
 
 

Modified: sis/branches/ISO-19115-3/storage/sis-storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/pom.xml?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/pom.xml (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/pom.xml Sat Dec  9 10:57:44 2017
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>storage</artifactId>
-    <version>0.8-jdk8-SNAPSHOT</version>
+    <version>1.0-jdk8-SNAPSHOT</version>
   </parent>
 
 

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractFeatureSet.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -28,17 +28,14 @@ import org.apache.sis.util.logging.Warni
  * @version 0.8
  * @since   0.8
  * @module
- *
- * @todo this class may be removed if we refactor {@link FeatureSet} as an abstract class.
  */
 public abstract class AbstractFeatureSet extends AbstractResource implements FeatureSet {
     /**
      * Creates a new resource.
      *
-     * @param store      the data store which contains this resource.
      * @param listeners  the set of registered warning listeners for the data store.
      */
-    protected AbstractFeatureSet(final DataStore store, final WarningListeners<DataStore> listeners) {
-        super(store, listeners);
+    protected AbstractFeatureSet(final WarningListeners<DataStore> listeners) {
+        super(listeners);
     }
 }

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -16,17 +16,19 @@
  */
 package org.apache.sis.internal.storage;
 
+import java.util.Locale;
 import org.opengis.geometry.Envelope;
 import org.opengis.metadata.Metadata;
 import org.opengis.metadata.extent.Extent;
-import org.opengis.metadata.extent.GeographicExtent;
 import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.opengis.metadata.extent.GeographicExtent;
 import org.opengis.metadata.identification.Identification;
+import org.apache.sis.geometry.GeneralEnvelope;
+import org.apache.sis.util.Localized;
+import org.apache.sis.util.logging.WarningListeners;
 import org.apache.sis.storage.Resource;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.geometry.GeneralEnvelope;
-import org.apache.sis.util.logging.WarningListeners;
 
 
 /**
@@ -36,46 +38,66 @@ import org.apache.sis.util.logging.Warni
  * @version 0.8
  * @since   0.8
  * @module
- *
- * @todo this class may be removed if we refactor {@link Resource} as an abstract class.
  */
-public abstract class AbstractResource implements Resource {
-    /**
-     * The data store which contains this resource.
-     */
-    protected final DataStore store;
-
+public abstract class AbstractResource implements Resource, Localized {
     /**
      * The set of registered warning listeners for the data store.
-     *
-     * @todo Remove this field if we move {@code AbstractResource} to the {@code org.apache.sis.storage} package,
-     *       since we would be able to access {@code DataStore.listeners} directly.
      */
-    private final WarningListeners<DataStore> listeners;
+    protected final WarningListeners<DataStore> listeners;
 
     /**
      * Creates a new resource.
      *
-     * @param store      the data store which contains this resource.
      * @param listeners  the set of registered warning listeners for the data store.
      */
-    protected AbstractResource(final DataStore store, final WarningListeners<DataStore> listeners) {
-        this.store     = store;
+    protected AbstractResource(final WarningListeners<DataStore> listeners) {
         this.listeners = listeners;
     }
 
     /**
+     * Returns the locale for error messages or warnings.
+     * Returns {@code null} if no locale is explicitly defined.
+     *
+     * @return the locale, or {@code null} if not explicitly defined.
+     */
+    @Override
+    public final Locale getLocale() {
+        return (listeners != null) ? listeners.getLocale() : null;
+    }
+
+    /**
+     * Returns the display name of the data store, or {@code null} if none.
+     * This is a convenience method for formatting error messages in subclasses.
+     *
+     * @return the data store display name, or {@code null}.
+     *
+     * @see DataStore#getDisplayName()
+     */
+    protected final String getStoreName() {
+        return (listeners != null) ? listeners.getSource().getDisplayName() : null;
+    }
+
+    /**
      * Returns the spatio-temporal envelope of this resource.
      * The default implementation computes the union of all {@link GeographicBoundingBox} in the resource metadata,
      * assuming the {@linkplain org.apache.sis.referencing.CommonCRS#defaultGeographic() default geographic CRS}
      * (usually WGS 84).
      *
-     * @return the spatio-temporal resource extent.
+     * @return the spatio-temporal resource extent, or {@code null} if none.
      * @throws DataStoreException if an error occurred while reading or computing the envelope.
      */
-    @Override
     public Envelope getEnvelope() throws DataStoreException {
-        final Metadata metadata = getMetadata();
+        return envelope(getMetadata());
+    }
+
+    /**
+     * Implementation of {@link #getEnvelope()}, provided as a separated method for
+     * {@link org.apache.sis.storage.DataSet} implementations that do not extend {@code AbstractResource}.
+     *
+     * @param  metadata  the metadata from which to compute the envelope, or {@code null}.
+     * @return the spatio-temporal resource extent, or {@code null} if none.
+     */
+    public static Envelope envelope(final Metadata metadata) {
         GeneralEnvelope bounds = null;
         if (metadata != null) {
             for (final Identification identification : metadata.getIdentificationInfo()) {
@@ -99,13 +121,4 @@ public abstract class AbstractResource i
         }
         return bounds;
     }
-
-    /**
-     * The set of registered warning listeners for the data store.
-     *
-     * @return the registered warning listeners for the data store.
-     */
-    protected final WarningListeners<DataStore> listeners() {
-        return listeners;
-    }
 }

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/DocumentedStoreProvider.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -16,12 +16,12 @@
  */
 package org.apache.sis.internal.storage;
 
-import java.util.logging.Logger;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
 import org.opengis.metadata.distribution.Format;
 import org.apache.sis.metadata.sql.MetadataSource;
 import org.apache.sis.metadata.sql.MetadataStoreException;
 import org.apache.sis.storage.DataStore;
-import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.logging.WarningListeners;
 import org.apache.sis.internal.system.Modules;
@@ -36,7 +36,7 @@ import org.apache.sis.internal.system.Mo
  * @since   0.8
  * @module
  */
-public abstract class DocumentedStoreProvider extends DataStoreProvider {
+public abstract class DocumentedStoreProvider extends URIDataStore.Provider {
     /**
      * The primary key to use for searching in the {@code MD_Format} table, or {@code null} if none.
      * This primary name is also the value returned by {@link #getShortName()} default implementation.
@@ -99,13 +99,17 @@ public abstract class DocumentedStorePro
             if (listeners != null) {
                 listeners.warning(null, e);
             } else {
-                final Logger logger = Logging.getLogger(Modules.STORAGE);
+                final Level level;
                 if (!logged) {
                     logged = true;      // Not atomic - not a big deal if we use warning level twice.
-                    Logging.unexpectedException(logger, getClass(), "getFormat", e);
+                    level = Level.WARNING;
                 } else {
-                    Logging.recoverableException(logger, getClass(), "getFormat", e);
+                    level = Level.FINE;
                 }
+                final LogRecord record = Resources.forLocale(null).getLogRecord(level,
+                        Resources.Keys.CanNotGetCommonMetadata_2, getShortName(), e.getLocalizedMessage());
+                record.setLoggerName(Modules.STORAGE);
+                Logging.log(getClass(), "getFormat", record);
             }
         }
         return super.getFormat();

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -24,16 +24,19 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.net.URI;
 import java.nio.charset.Charset;
 import javax.measure.Unit;
 import org.opengis.util.MemberName;
 import org.opengis.util.GenericName;
 import org.opengis.util.InternationalString;
+import org.opengis.geometry.Geometry;
 import org.opengis.metadata.Identifier;
 import org.opengis.metadata.citation.Role;
 import org.opengis.metadata.citation.DateType;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.metadata.citation.CitationDate;
+import org.opengis.metadata.citation.OnLineFunction;
 import org.opengis.metadata.spatial.GCP;
 import org.opengis.metadata.spatial.Dimension;
 import org.opengis.metadata.spatial.DimensionNameType;
@@ -42,6 +45,7 @@ import org.opengis.metadata.spatial.Pixe
 import org.opengis.metadata.spatial.GeolocationInformation;
 import org.opengis.metadata.spatial.SpatialRepresentationType;
 import org.opengis.metadata.constraint.Restriction;
+import org.opengis.metadata.content.CoverageContentType;
 import org.opengis.metadata.content.TransferFunctionType;
 import org.opengis.metadata.maintenance.ScopeCode;
 import org.opengis.metadata.acquisition.Context;
@@ -62,6 +66,7 @@ import org.apache.sis.metadata.iso.Defau
 import org.apache.sis.metadata.iso.extent.DefaultExtent;
 import org.apache.sis.metadata.iso.extent.DefaultVerticalExtent;
 import org.apache.sis.metadata.iso.extent.DefaultTemporalExtent;
+import org.apache.sis.metadata.iso.extent.DefaultBoundingPolygon;
 import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
 import org.apache.sis.metadata.iso.extent.DefaultGeographicDescription;
 import org.apache.sis.metadata.iso.spatial.DefaultGridSpatialRepresentation;
@@ -83,6 +88,7 @@ import org.apache.sis.metadata.iso.citat
 import org.apache.sis.metadata.iso.citation.DefaultResponsibility;
 import org.apache.sis.metadata.iso.citation.DefaultIndividual;
 import org.apache.sis.metadata.iso.citation.DefaultOrganisation;
+import org.apache.sis.metadata.iso.citation.DefaultOnlineResource;
 import org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints;
 import org.apache.sis.metadata.iso.identification.DefaultKeywords;
 import org.apache.sis.metadata.iso.identification.DefaultResolution;
@@ -875,6 +881,7 @@ public class MetadataBuilder {
      * @param  scope      whether the date applies to data, to metadata or to both.
      *
      * @see #addTitle(CharSequence)
+     * @see #addTitleOrIdentifier(String, Scope)
      */
     public final void addIdentifier(final CharSequence authority, String code, final Scope scope) {
         ArgumentChecks.ensureNonNull("scope", scope);
@@ -1072,7 +1079,7 @@ public class MetadataBuilder {
      * Storage location is:
      *
      * <ul>
-     *   <li>{@code metadata/identificationInfo/citation/title} if available</li>
+     *   <li>{@code metadata/identificationInfo/citation/title} if not yet used</li>
      *   <li>{@code metadata/identificationInfo/citation/alternateTitle} otherwise</li>
      * </ul>
      *
@@ -1094,12 +1101,56 @@ public class MetadataBuilder {
     }
 
     /**
+     * Adds the given code as a title if the current citation has no title, or as an identifier otherwise.
+     * This method is invoked when adding an identifier to a metadata that may have no title. Because the
+     * title is mandatory, adding only an identifier would make an invalid metadata.
+     *
+     * @param  code   the identifier code, or {@code null} for no-operation.
+     * @param  scope  whether the date applies to data, to metadata or to both.
+     *
+     * @see #addTitle(CharSequence)
+     * @see #addIdentifier(CharSequence, String, Scope)
+     */
+    public final void addTitleOrIdentifier(final String code, Scope scope) {
+        ArgumentChecks.ensureNonNull("scope", scope);
+        if (scope != Scope.METADATA) {
+            if (citation == null || citation.getTitle() == null) {
+                addTitle(code);
+                if (scope == Scope.RESOURCE) {
+                    return;
+                }
+                scope = Scope.METADATA;
+            }
+        }
+        addIdentifier(null, code, scope);
+    }
+
+    /**
+     * Adds a version of the resource.
+     * If a version already exists, the new one will be appended after a new line.
+     * Storage location is:
+     *
+     * <ul>
+     *   <li>{@code metadata/identificationInfo/citation/edition}</li>
+     * </ul>
+     *
+     * @param version  the version of resource(s), or {@code null} for no-operation.
+     */
+    public final void addEdition(final CharSequence version) {
+        final InternationalString i18n = trim(version);
+        if (i18n != null) {
+            final DefaultCitation citation = citation();
+            citation.setEdition(append(citation.getEdition(), i18n));
+        }
+    }
+
+    /**
      * Adds a brief narrative summary of the resource(s).
-     * If a summary already existed, the new one will be appended after a new line.
+     * If a summary already exists, the new one will be appended after a new line.
      * Storage location is:
      *
      * <ul>
-     *   <li>{@code metadata/identificationInfo/abstract}
+     *   <li>{@code metadata/identificationInfo/abstract}</li>
      * </ul>
      *
      * @param description  the summary of resource(s), or {@code null} for no-operation.
@@ -1117,7 +1168,7 @@ public class MetadataBuilder {
 
     /**
      * Adds a summary of the intentions with which the resource(s) was developed.
-     * If a purpose already existed, the new one will be appended after a new line.
+     * If a purpose already exists, the new one will be appended after a new line.
      * Storage location is:
      *
      * <ul>
@@ -1155,7 +1206,7 @@ public class MetadataBuilder {
 
     /**
      * Adds any other descriptive information about the resource.
-     * If information already existed, the new one will be appended after a new line.
+     * If information already exists, the new one will be appended after a new line.
      * Storage location is:
      *
      * <ul>
@@ -1612,6 +1663,22 @@ parse:      for (int i = 0; i < length;)
     }
 
     /**
+     * Adds the given geometry as a bounding polygon.
+     * Storage locations is:
+     *
+     * <ul>
+     *   <li>{@code metadata/identificationInfo/extent/geographicElement/polygon}</li>
+     * </ul>
+     *
+     * @param  bounds  the bounding polygon, or {@code null} if none.
+     */
+    public final void addBoundingPolygon(final Geometry bounds) {
+        if (bounds != null) {
+            addIfNotPresent(extent().getGeographicElements(), new DefaultBoundingPolygon(bounds));
+        }
+    }
+
+    /**
      * Adds a geographic extent described by an identifier. The given identifier is stored as-is as
      * the natural language description, and possibly in a modified form as the geographic identifier.
      * See {@link DefaultGeographicDescription#DefaultGeographicDescription(CharSequence)} for details.
@@ -2000,6 +2067,22 @@ parse:      for (int i = 0; i < length;)
     }
 
     /**
+     * Adds type of information represented in the cell.
+     * Storage location is:
+     *
+     * <ul>
+     *   <li>{@code metadata/contentInfo/attributeGroup/contentType}</li>
+     * </ul>
+     *
+     * @param  type  type of information represented in the cell, or {@code null} for no-operation.
+     */
+    public final void addContentType(final CoverageContentType type) {
+        if (type != null) {
+            attributeGroup().getContentTypes().add(type);
+        }
+    }
+
+    /**
      * Sets the name or number that uniquely identifies instances of bands of wavelengths on which a sensor operates.
      * If a coverage contains more than one band, additional bands can be created by calling
      * {@link #newSampleDimension()} before to call this method.
@@ -2059,7 +2142,7 @@ parse:      for (int i = 0; i < length;)
      * @param  authority  identifies which controlled list of name is used, or {@code null} if none.
      * @param  name       the band name, or {@code null} for no-operation.
      */
-    public final void addBandIdentifier(final CharSequence authority, String name) {
+    public final void addBandName(final CharSequence authority, String name) {
         if (name != null && !(name = name.trim()).isEmpty()) {
             addIfNotPresent(sampleDimension().getNames(), sharedIdentifier(authority, name));
         }
@@ -2372,6 +2455,26 @@ parse:      for (int i = 0; i < length;)
     }
 
     /**
+     * Adds the identifier of the operation used to acquire the dataset.
+     * Examples: "GHRSST", "NOAA CDR", "NASA EOS", "JPSS", "GOES-R".
+     * Storage location is:
+     *
+     * <ul>
+     *   <li>{@code metadata/acquisitionInformation/operation/identifier}</li>
+     * </ul>
+     *
+     * @param  program     identification of the mission, or {@code null} if none.
+     * @param  identifier  unique identification of the operation, or {@code null} for no-operation.
+     */
+    public final void addAcquisitionOperation(final CharSequence program, String identifier) {
+        if (identifier != null && !(identifier = identifier.trim()).isEmpty()) {
+            final DefaultOperation r = new DefaultOperation();
+            r.setIdentifier(sharedIdentifier(program, identifier));
+            addIfNotPresent(acquisition().getOperations(), r);
+        }
+    }
+
+    /**
      * Adds the identifier of the requirement to be satisfied by data acquisition.
      * Storage location is:
      *
@@ -2500,6 +2603,25 @@ parse:      for (int i = 0; i < length;)
         }
     }
 
+    /**
+     * Adds a URL to a more complete description of the metadata.
+     *
+     * <ul>
+     *   <li>{@code metadata/metadataLinkage/linkage}
+     *     with {@code function} set to {@link OnLineFunction#COMPLETE_METADATA}</li>
+     * </ul>
+     *
+     * @param  link
+     */
+    public final void addCompleteMetadata(final URI link) {
+        if (link != null) {
+            final DefaultOnlineResource ln = new DefaultOnlineResource(link);
+            ln.setFunction(OnLineFunction.COMPLETE_METADATA);
+            ln.setProtocol(link.getScheme());
+            addIfNotPresent(metadata().getMetadataLinkages(), ln);
+        }
+    }
+
     /**
      * Returns the metadata (optionally as an unmodifiable object), or {@code null} if none.
      * If {@code freeze} is {@code true}, then the returned metadata instance can not be modified.

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -32,7 +32,7 @@ import org.apache.sis.util.resources.Res
  * all modules in the Apache SIS project, see {@link org.apache.sis.util.resources} package.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -67,6 +67,21 @@ public final class Resources extends Ind
         public static final short AmbiguousName_4 = 15;
 
         /**
+         * Can not get metadata common to “{0}” files. Reason: {1}
+         */
+        public static final short CanNotGetCommonMetadata_2 = 39;
+
+        /**
+         * Can not read the Coordinate Reference System (CRS) Well Known Text (WKT) in “{0}”.
+         */
+        public static final short CanNotReadCRS_WKT_1 = 37;
+
+        /**
+         * Can not read “{0}” directory.
+         */
+        public static final short CanNotReadDirectory_1 = 34;
+
+        /**
          * Can not read “{1}” as a file in the {0} format.
          */
         public static final short CanNotReadFile_2 = 1;
@@ -102,6 +117,31 @@ public final class Resources extends Ind
         public static final short ConcurrentWrite_1 = 20;
 
         /**
+         * Character encoding used by the data store.
+         */
+        public static final short DataStoreEncoding = 29;
+
+        /**
+         * Formating conventions of dates and numbers.
+         */
+        public static final short DataStoreLocale = 30;
+
+        /**
+         * Data store location as a file or URL.
+         */
+        public static final short DataStoreLocation = 31;
+
+        /**
+         * Timezone of dates in the data store.
+         */
+        public static final short DataStoreTimeZone = 32;
+
+        /**
+         * Content of “{0}” directory.
+         */
+        public static final short DirectoryContent_1 = 35;
+
+        /**
          * Character string in the “{0}” file is too long. The string has {2} characters while the
          * limit is {1}.
          */
@@ -118,6 +158,11 @@ public final class Resources extends Ind
         public static final short FeatureNotFound_2 = 17;
 
         /**
+         * Whether to assemble trajectory fragments (lines in CSV file) in a single feature instance.
+         */
+        public static final short FoliationRepresentation = 38;
+
+        /**
          * The {0} data store does not accept features of type “{1}”.
          */
         public static final short IllegalFeatureType_2 = 7;
@@ -164,11 +209,31 @@ public final class Resources extends Ind
         public static final short ShallBeDeclaredBefore_2 = 22;
 
         /**
+         * The “{0}” directory is used more than once because of symbolic links.
+         */
+        public static final short SharedDirectory_1 = 36;
+
+        /**
+         * Write operations are not supported.
+         */
+        public static final short StoreIsReadOnly = 28;
+
+        /**
          * Can not move backward in the “{0}” stream.
          */
         public static final short StreamIsForwardOnly_1 = 13;
 
         /**
+         * Stream “{0}” is not readable.
+         */
+        public static final short StreamIsNotReadable_1 = 25;
+
+        /**
+         * Stream “{0}” is not writable.
+         */
+        public static final short StreamIsNotWritable_1 = 26;
+
+        /**
          * The “{0}” data store can be read only once.
          */
         public static final short StreamIsReadOnce_1 = 18;
@@ -179,9 +244,19 @@ public final class Resources extends Ind
         public static final short StreamIsWriteOnce_1 = 21;
 
         /**
+         * Can not open {0} data store without “{1}” parameter.
+         */
+        public static final short UndefinedParameter_2 = 27;
+
+        /**
          * Format of “{0}” is not recognized.
          */
         public static final short UnknownFormatFor_1 = 14;
+
+        /**
+         * Used only if this information is not encoded with the data.
+         */
+        public static final short UsedOnlyIfNotEncoded = 33;
     }
 
     /**

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources.properties [ISO-8859-1] Sat Dec  9 10:57:44 2017
@@ -20,6 +20,9 @@
 # For resources shared by all modules in the Apache SIS project, see "org.apache.sis.util.resources" package.
 #
 AmbiguousName_4                   = Name \u201c{3}\u201d is ambiguous because it can be understood as either \u201c{1}\u201d or \u201c{2}\u201d in the context of \u201c{0}\u201d data.
+CanNotGetCommonMetadata_2         = Can not get metadata common to \u201c{0}\u201d files. Reason: {1}
+CanNotReadCRS_WKT_1               = Can not read the Coordinate Reference System (CRS) Well Known Text (WKT) in \u201c{0}\u201d.
+CanNotReadDirectory_1             = Can not read \u201c{0}\u201d directory.
 CanNotReadFile_2                  = Can not read \u201c{1}\u201d as a file in the {0} format.
 CanNotReadFile_3                  = Can not read line {2} of \u201c{1}\u201d as part of a file in the {0} format.
 CanNotReadFile_4                  = Can not read line {2} (after column {3}) of \u201c{1}\u201d as part of a file in the {0} format.
@@ -27,8 +30,14 @@ ClosedReader_1                    = This
 ClosedWriter_1                    = This {0} writer is closed.
 ConcurrentRead_1                  = One or more read operations are in progress in the \u201c{0}\u201d data store.
 ConcurrentWrite_1                 = A write operation is in progress in the \u201c{0}\u201d data store.
+DataStoreEncoding                 = Character encoding used by the data store.
+DataStoreLocale                   = Formating conventions of dates and numbers.
+DataStoreLocation                 = Data store location as a file or URL.
+DataStoreTimeZone                 = Timezone of dates in the data store.
+DirectoryContent_1                = Content of \u201c{0}\u201d directory.
 FeatureAlreadyPresent_2           = A feature named \u201c{1}\u201d is already present in the \u201c{0}\u201d data store.
 FeatureNotFound_2                 = Feature \u201c{1}\u201d has not been found in the \u201c{0}\u201d data store.
+FoliationRepresentation           = Whether to assemble trajectory fragments (lines in CSV file) in a single feature instance.
 ExcessiveStringSize_3             = Character string in the \u201c{0}\u201d file is too long. The string has {2} characters while the limit is {1}.
 IllegalFeatureType_2              = The {0} data store does not accept features of type \u201c{1}\u201d.
 IllegalInputTypeForReader_2       = The {0} reader does not accept inputs of type \u2018{1}\u2019.
@@ -39,7 +48,13 @@ ProcessingExecutedOn_1            = Proc
 ResourceIdentifierCollision_2     = More than one resource have the \u201c{1}\u201d identifier in the \u201c{0}\u201d data store.
 ResourceNotFound_2                = No resource found for the \u201c{1}\u201d identifier in the \u201c{0}\u201d data store.
 ShallBeDeclaredBefore_2           = The \u201c{1}\u201d element must be declared before \u201c{0}\u201d.
+SharedDirectory_1                 = The \u201c{0}\u201d directory is used more than once because of symbolic links.
+StoreIsReadOnly                   = Write operations are not supported.
 StreamIsForwardOnly_1             = Can not move backward in the \u201c{0}\u201d stream.
+StreamIsNotReadable_1             = Stream \u201c{0}\u201d is not readable.
+StreamIsNotWritable_1             = Stream \u201c{0}\u201d is not writable.
 StreamIsReadOnce_1                = The \u201c{0}\u201d data store can be read only once.
 StreamIsWriteOnce_1               = Can not modify previously written data in \u201c{0}\u201d.
+UndefinedParameter_2              = Can not open {0} data store without \u201c{1}\u201d parameter.
 UnknownFormatFor_1                = Format of \u201c{0}\u201d is not recognized.
+UsedOnlyIfNotEncoded              = Used only if this information is not encoded with the data.

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties [ISO-8859-1] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Resources_fr.properties [ISO-8859-1] Sat Dec  9 10:57:44 2017
@@ -25,6 +25,9 @@
 #   U+00A0 NO-BREAK SPACE         before  :
 #
 AmbiguousName_4                   = Le nom \u00ab\u202f{3}\u202f\u00bb est ambigu\u00eb car il peut \u00eatre interpr\u00e9t\u00e9 aussi bien comme \u00ab\u202f{1}\u202f\u00bb ou \u00ab\u202f{2}\u202f\u00bb dans le contexte des donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
+CanNotGetCommonMetadata_2         = Ne peut pas obtenir les m\u00e9ta-donn\u00e9es communes aux fichiers \u00ab\u202f{0}\u202f\u00bb. Raison\u2008: {1}
+CanNotReadCRS_WKT_1               = Ne peut pas lire le syst\u00e8me de r\u00e9f\u00e9rence spatial dans le \u00ab\u202fWell Known Text\u202f\u00bb (WKT) de \u00ab\u202f{0}\u202f\u00bb.
+CanNotReadDirectory_1             = Ne peut pas lire le r\u00e9pertoire \u00ab\u202f{0}\u202f\u00bb.
 CanNotReadFile_2                  = Ne peut pas lire \u00ab\u202f{1}\u202f\u00bb comme un fichier au format {0}.
 CanNotReadFile_3                  = Ne peut pas lire la ligne {2} de \u00ab\u202f{1}\u202f\u00bb comme une partie d\u2019un fichier au format {0}.
 CanNotReadFile_4                  = Ne peut pas lire la ligne {2} (apr\u00e8s la colonne {3}) de \u00ab\u202f{1}\u202f\u00bb comme une partie d\u2019un fichier au format {0}.
@@ -32,9 +35,15 @@ ClosedReader_1                    = Ce l
 ClosedWriter_1                    = Cet encodeur {0} est ferm\u00e9.
 ConcurrentRead_1                  = Une ou plusieurs op\u00e9rations de lecture sont en cours sur les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
 ConcurrentWrite_1                 = Une op\u00e9ration d\u2019\u00e9criture est en cours sur les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
+DataStoreEncoding                 = Encodage des caract\u00e8res utilis\u00e9 par la source de donn\u00e9es.
+DataStoreLocale                   = Conventions d\u2019\u00e9criture des dates et des nombres.
+DataStoreLocation                 = Chemin (fichier ou URL) vers la source de donn\u00e9es.
+DataStoreTimeZone                 = Fuseau horaire des dates dans les donn\u00e9es.
+DirectoryContent_1                = Contenu du r\u00e9pertoire \u00ab\u202f{0}\u202f\u00bb.
 ExcessiveStringSize_3             = La cha\u00eene de caract\u00e8res dans le fichier \u00ab\u202f{0}\u202f\u00bb est trop longue. La cha\u00eene fait {2} caract\u00e8res alors que la limite est {1}.
 FeatureAlreadyPresent_2           = Une entit\u00e9 nomm\u00e9e \u00ab\u202f{1}\u202f\u00bb est d\u00e9j\u00e0 pr\u00e9sente dans les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
-FeatureNotFound_2                 = L\u2019entit\u00e9 \u00ab\u202f{1}\u202f\u00bb n\u2019est pas \u00e9t\u00e9 trouv\u00e9e dans les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
+FeatureNotFound_2                 = L\u2019entit\u00e9 \u00ab\u202f{1}\u202f\u00bb n\u2019a pas \u00e9t\u00e9 trouv\u00e9e dans les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
+FoliationRepresentation           = Indique s\u2019il faut assembler les fragments de trajectoires (lignes dans un fichier CSV) dans une entit\u00e9 unique.
 IllegalFeatureType_2              = Le format {0} ne stocke pas de donn\u00e9es de type \u00ab\u202f{1}\u202f\u00bb.
 IllegalInputTypeForReader_2       = Le lecteur {0} n\u2019accepte pas des entr\u00e9s de type \u2018{1}\u2019.
 IllegalOutputTypeForWriter_2      = Le l\u2019encodeur {0} n\u2019accepte pas des sorties de type \u2018{1}\u2019.
@@ -44,7 +53,13 @@ ProcessingExecutedOn_1            = Trai
 ResourceIdentifierCollision_2     = Plusieurs ressources utilisent l\u2019identifiant \u00ab\u202f{1}\u202f\u00bb dans les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
 ResourceNotFound_2                = Aucune ressource n\u2019a \u00e9t\u00e9 trouv\u00e9e pour l\u2019identifiant \u00ab\u202f{1}\u202f\u00bb dans les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb.
 ShallBeDeclaredBefore_2           = L\u2019\u00e9l\u00e9ment \u00ab\u202f{1}\u202f\u00bb doit \u00eatre d\u00e9clar\u00e9 avant \u00ab\u202f{0}\u202f\u00bb.
+SharedDirectory_1                 = Le r\u00e9pertoire \u00ab\u202f{0}\u202f\u00bb est utilis\u00e9 plus d\u2019une fois \u00e0 cause des liens symboliques.
+StoreIsReadOnly                   = Les op\u00e9rations d\u2019\u00e9criture ne sont pas support\u00e9es.
 StreamIsForwardOnly_1             = Ne peut pas reculer dans le flux de donn\u00e9es \u00ab\u202f{0}\u202f\u00bb.
+StreamIsNotReadable_1             = Les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb ne sont pas accessibles en lecture.
+StreamIsNotWritable_1             = Le flux de donn\u00e9es \u00ab\u202f{0}\u202f\u00bb ne g\u00e8re pas les \u00e9critures.
 StreamIsReadOnce_1                = Les donn\u00e9es de \u00ab\u202f{0}\u202f\u00bb ne peuvent \u00eatre lues qu\u2019une seule fois.
 StreamIsWriteOnce_1               = Ne peut pas revenir sur les donn\u00e9es d\u00e9j\u00e0 \u00e9crites dans \u00ab\u202f{0}\u202f\u00bb.
+UndefinedParameter_2              = Ne peut pas ouvrir une source de donn\u00e9es {0} sans le param\u00e8tre \u00ab\u202f{1}\u202f\u00bb.
 UnknownFormatFor_1                = Le format de \u00ab\u202f{0}\u202f\u00bb n\u2019est pas reconnu.
+UsedOnlyIfNotEncoded              = Utilis\u00e9 seulement si cette information n\u2019est pas encod\u00e9e avec les donn\u00e9es.

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreTypeDetector.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreTypeDetector.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreTypeDetector.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/StoreTypeDetector.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -33,7 +33,7 @@ import org.apache.sis.storage.DataStoreE
  * @since   0.4
  * @module
  */
-public class StoreTypeDetector extends FileTypeDetector {
+public final class StoreTypeDetector extends FileTypeDetector {
     /**
      * Constructor for {@link java.util.ServiceLoader}.
      */

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -31,36 +31,43 @@ import java.net.URI;
 import java.nio.charset.Charset;
 import javax.measure.Unit;
 import javax.measure.quantity.Time;
-import org.opengis.metadata.Metadata;
 import org.opengis.util.FactoryException;
+import org.opengis.geometry.Envelope;
+import org.opengis.metadata.Metadata;
 import org.opengis.metadata.maintenance.ScopeCode;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.crs.TemporalCRS;
 import org.opengis.referencing.operation.TransformException;
 import org.apache.sis.feature.DefaultAttributeType;
 import org.apache.sis.feature.DefaultFeatureType;
+import org.apache.sis.feature.FoliationRepresentation;
 import org.apache.sis.referencing.CRS;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.internal.referencing.GeodeticObjectBuilder;
 import org.apache.sis.internal.util.UnmodifiableArrayList;
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.storage.io.IOUtilities;
+import org.apache.sis.internal.storage.io.RewindableLineReader;
 import org.apache.sis.internal.feature.Geometries;
 import org.apache.sis.internal.feature.MovingFeature;
 import org.apache.sis.internal.storage.Resources;
+import org.apache.sis.internal.storage.URIDataStore;
 import org.apache.sis.geometry.GeneralEnvelope;
+import org.apache.sis.geometry.ImmutableEnvelope;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.metadata.sql.MetadataStoreException;
-import org.apache.sis.storage.Resource;
-import org.apache.sis.storage.DataStore;
+import org.apache.sis.storage.DataOptionKey;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.storage.DataStoreReferencingException;
+import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.storage.FeatureSet;
 import org.apache.sis.setup.OptionKey;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.resources.Errors;
+import org.apache.sis.io.InvalidSeekException;
 import org.apache.sis.measure.Units;
 
 // Branch-dependent imports
@@ -79,11 +86,11 @@ import org.opengis.feature.AttributeType
  * See package javadoc for more information on the syntax.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.7
  * @module
  */
-public final class Store extends DataStore {
+final class Store extends URIDataStore implements FeatureSet {
     /**
      * The character at the beginning of lines to ignore in the header.
      * Note that this is not part of OGC Moving Feature Specification.
@@ -153,8 +160,9 @@ public final class Store extends DataSto
      * and a temporal component if the CSV file contains a start time and end time.
      *
      * @see #parseEnvelope(List)
+     * @see #getEnvelope()
      */
-    private final GeneralEnvelope envelope;
+    private final ImmutableEnvelope envelope;
 
     /**
      * Description of the columns found in the CSV file.
@@ -221,27 +229,25 @@ public final class Store extends DataSto
      *
      * @param  provider   the factory that created this {@code DataStore} instance, or {@code null} if unspecified.
      * @param  connector  information about the storage (URL, stream, <i>etc</i>).
-     * @param  immediate  {@code true} for forcing the creation of a distinct {@code Feature} instance for each line.
      * @throws DataStoreException if an error occurred while opening the stream.
      */
-    public Store(final StoreProvider provider, final StorageConnector connector, final boolean immediate)
-            throws DataStoreException
-    {
+    public Store(final StoreProvider provider, final StorageConnector connector) throws DataStoreException {
         super(provider, connector);
         final Reader r = connector.getStorageAs(Reader.class);
         connector.closeAllExcept(r);
         if (r == null) {
-            throw new DataStoreException(Errors.format(Errors.Keys.CanNotOpen_1, super.getDisplayName()));
+            throw new UnsupportedStorageException(super.getLocale(), StoreProvider.NAME,
+                    connector.getStorage(), connector.getOption(OptionKey.OPEN_OPTIONS));
         }
-        source = (r instanceof BufferedReader) ? (BufferedReader) r : new LineNumberReader(r);
+        source     = (r instanceof BufferedReader) ? (BufferedReader) r : new LineNumberReader(r);
         geometries = Geometries.implementation(connector.getOption(OptionKey.GEOMETRY_LIBRARY));
-        dissociate = immediate;
+        dissociate = FoliationRepresentation.FRAGMENTED.equals(connector.getOption(DataOptionKey.FOLIATION_REPRESENTATION));
         GeneralEnvelope envelope    = null;
         FeatureType     featureType = null;
         Foliation       foliation   = null;
         try {
             final List<String> elements = new ArrayList<>();
-            source.mark(1024);
+            source.mark(RewindableLineReader.BUFFER_SIZE);
             String line;
             while ((line = source.readLine()) != null) {
                 line = line.trim();
@@ -287,9 +293,9 @@ public final class Store extends DataSto
                     }
                 }
                 elements.clear();
-                source.mark(1024);
+                source.mark(RewindableLineReader.BUFFER_SIZE);
             }
-            source.reset();
+            source.reset();                 // Restore position to the first line after the header.
         } catch (IOException e) {
             throw new DataStoreException(getLocale(), StoreProvider.NAME, super.getDisplayName(), source).initCause(e);
         } catch (FactoryException e) {
@@ -298,13 +304,40 @@ public final class Store extends DataSto
             throw new DataStoreContentException(getLocale(), StoreProvider.NAME, super.getDisplayName(), source).initCause(e);
         }
         this.encoding    = connector.getOption(OptionKey.ENCODING);
-        this.envelope    = envelope;
+        this.envelope    = new ImmutableEnvelope(envelope);
         this.featureType = featureType;
         this.foliation   = foliation;
         this.dissociate |= (timeEncoding == null);
     }
 
     /**
+     * Moves the reader position to beginning of file, if possible. We try to use the mark defined by the constructor,
+     * which is set after the last header line. If the mark is no longer valid, then we have to create a new line reader.
+     * In this later case, we have to skip the header lines (i.e. we reproduce the constructor loop, but without parsing
+     * metadata).
+     */
+    private void rewind() throws IOException {
+        final BufferedReader reader = source;
+        if (!(reader instanceof RewindableLineReader)) {
+            throw new InvalidSeekException(Resources.forLocale(getLocale())
+                    .getString(Resources.Keys.StreamIsForwardOnly_1, getDisplayName()));
+        }
+        source = ((RewindableLineReader) reader).rewind();
+        if (source != reader) {
+            String line;
+            while ((line = source.readLine()) != null) {
+                line = line.trim();
+                if (!line.isEmpty()) {
+                    final char c = line.charAt(0);
+                    if (c != COMMENT && c != METADATA) break;
+                }
+                source.mark(RewindableLineReader.BUFFER_SIZE);
+            }
+            source.reset();         // Restore position to the first line after the header.
+        }
+    }
+
+    /**
      * Parses the envelope described by the header line starting with {@code @stboundedby}.
      * The envelope returned by this method will be stored in the {@link #envelope} field.
      *
@@ -613,19 +646,36 @@ public final class Store extends DataSto
                 listeners.warning(null, e);
             }
             builder.addFeatureType(featureType, null);
+            addTitleOrIdentifier(builder);
             metadata = builder.build(true);
         }
         return metadata;
     }
 
     /**
-     * Returns the {@code FeatureSet} from which all features in this data store can be accessed.
+     * Returns the spatio-temporal extent of CSV data in coordinate reference system of the CSV file.
+     */
+    @Override
+    public Envelope getEnvelope() throws DataStoreException {
+        return envelope;
+    }
+
+    /**
+     * Returns the type of features in the CSV file. The feature type name will be the value
+     * specified at the following path (only one such value exists for a CSV data store):
      *
-     * @return the starting point of all features in this data store.
+     * <blockquote>
+     * {@link #getMetadata()} /
+     * {@link org.apache.sis.metadata.iso.DefaultMetadata#getContentInfo() contentInfo} /
+     * {@link org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription#getFeatureTypeInfo() featureTypes} /
+     * {@link org.apache.sis.metadata.iso.content.DefaultFeatureTypeInfo#getFeatureTypeName() featureTypeName}
+     * </blockquote>
+     *
+     * @return type of features in the CSV file.
      */
     @Override
-    public Resource getRootResource() {
-        return new FeatureAccess(this, listeners);
+    public FeatureType getType() {
+        return featureType;
     }
 
     /**
@@ -635,10 +685,11 @@ public final class Store extends DataSto
      * @return a stream over all features in the CSV file.
      * @throws DataStoreException if an error occurred while creating the feature stream.
      *
-     * @todo Needs to reset the position when doing another pass on the features.
+     * @todo Need to reset the position when doing another pass on the features. See {@link #rewind()}.
      * @todo If sequential order, publish Feature as soon as identifier changed.
      */
-    final synchronized Stream<Feature> features(final boolean parallel) throws DataStoreException {
+    @Override
+    public final synchronized Stream<Feature> features(final boolean parallel) throws DataStoreException {
         /*
          * If the user asks for one feature instance per line, then we can return a FeatureIter instance directly.
          * Since each feature is fully constructed from a single line and each line are read atomically, we can

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -16,14 +16,23 @@
  */
 package org.apache.sis.internal.storage.csv;
 
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.parameter.Parameters;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreProvider;
+import org.apache.sis.storage.DataOptionKey;
 import org.apache.sis.storage.ProbeResult;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.feature.FoliationRepresentation;
+import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.internal.storage.Capability;
 import org.apache.sis.internal.storage.Capabilities;
+import org.apache.sis.internal.storage.URIDataStore;
 import org.apache.sis.internal.storage.wkt.FirstKeywordPeek;
+import org.apache.sis.util.ArgumentChecks;
 
 
 /**
@@ -35,12 +44,12 @@ import org.apache.sis.internal.storage.w
  * the part of the caller. However the {@link Store} instances created by this factory are not thread-safe.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
 @Capabilities(Capability.READ)
-public final class StoreProvider extends DataStoreProvider {
+public final class StoreProvider extends URIDataStore.Provider {
     /**
      * The format names for static features and moving features.
      */
@@ -101,6 +110,19 @@ public final class StoreProvider extends
     }
 
     /**
+     * Description of the optional parameter for specifying whether the reader should assemble distinct CSV lines
+     * into a single {@code Feature} instance forming a foliation. This is ignored if the CSV file does not seem
+     * to contain moving features.
+     */
+    private static final ParameterDescriptor<FoliationRepresentation> FOLIATION;
+    static {
+        final ParameterBuilder builder = new ParameterBuilder();
+        FOLIATION = builder.addName("foliation")
+                .setDescription(Resources.formatInternational(Resources.Keys.FoliationRepresentation))
+                .create(FoliationRepresentation.class, FoliationRepresentation.ASSEMBLED);
+    }
+
+    /**
      * Creates a new provider.
      */
     public StoreProvider() {
@@ -138,6 +160,32 @@ public final class StoreProvider extends
      */
     @Override
     public DataStore open(final StorageConnector connector) throws DataStoreException {
-        return new Store(this, connector, false);
+        return new Store(this, connector);
+    }
+
+    /**
+     * Returns a CSV {@link Store} implementation from the given parameters.
+     *
+     * @return a data store implementation associated with this provider for the given parameters.
+     * @throws DataStoreException if an error occurred while creating the data store instance.
+     */
+    @Override
+    public DataStore open(final ParameterValueGroup parameters) throws DataStoreException {
+        ArgumentChecks.ensureNonNull("parameter", parameters);
+        final StorageConnector connector = connector(this, parameters);
+        final Parameters pg = Parameters.castOrWrap(parameters);
+        connector.setOption(DataOptionKey.ENCODING, pg.getValue(ENCODING));
+        connector.setOption(DataOptionKey.FOLIATION_REPRESENTATION, pg.getValue(FOLIATION));
+        return new Store(this, connector);
+    }
+
+    /**
+     * Invoked by {@link #getOpenParameters()} the first time that a parameter descriptor needs to be created.
+     *
+     * @return the parameters descriptor for CSV files.
+     */
+    @Override
+    protected ParameterDescriptorGroup build(final ParameterBuilder builder) {
+        return builder.createGroup(LOCATION_PARAM, ENCODING, FOLIATION);
     }
 }

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/package-info.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/package-info.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/package-info.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -53,7 +53,7 @@
  * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.7
  * @module
  */

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelData.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -49,7 +49,8 @@ public abstract class ChannelData implem
     private static final int BIT_OFFSET_SIZE = 3;
 
     /**
-     * A file identifier used only for formatting error message.
+     * A short identifier (typically a filename without path) used for formatting error message.
+     * This is often the value given by {@link org.apache.sis.storage.StorageConnector#getStorageName()}.
      */
     public final String filename;
 
@@ -62,8 +63,11 @@ public abstract class ChannelData implem
      * The position of the channel when this {@code ChannelData} has been created.
      * This is almost always 0, but we allow other values in case the data to read
      * or write are part of a bigger file.
+     *
+     * <p>This value is added to the argument given to the {@link #seek(long)} method. Users can ignore
+     * this field, unless they want to invoke {@link SeekableByteChannel#position(long)} directly.</p>
      */
-    final long channelOffset;
+    public final long channelOffset;
 
     /**
      * The channel position where is located the {@link #buffer} value at index 0.
@@ -111,7 +115,7 @@ public abstract class ChannelData implem
      * Creates a new instance for the given channel and using the given buffer.
      * The channel is not stored by this class - it shall be stored by the subclass.
      *
-     * @param  filename  a file identifier used only for formatting error message.
+     * @param  filename  a short identifier (typically a filename without path) used for formatting error message.
      * @param  channel   the channel from where data are read or where to wrote.
      * @param  buffer    the buffer where to store the data.
      * @throws IOException if an error occurred while reading the channel.
@@ -272,13 +276,11 @@ public abstract class ChannelData implem
      * An {@code IOException} may be be thrown if the previous marked position lies in the
      * discarded portion of the stream.
      *
-     * <p>This method differs from the {@link javax.imageio.stream.ImageInputStream} contract in two aspects:</p>
-     * <ul>
-     *   <li>This method may, under some conditions, be able to perform its work even if the marked
-     *       position is before the flushed position.</li>
-     *   <li>If there is no mark, this method throws an {@link InvalidMarkException} rather than
-     *       doing nothing. Doing nothing is considered a too high risk of error.</li>
-     * </ul>
+     * <div class="section">Departure from Image I/O specification</div>
+     * The {@link javax.imageio.stream.ImageInputStream#reset()} contract specifies that if there is no matching mark,
+     * then this method shall do nothing. This method throws {@link InvalidMarkException} instead; silently ignoring
+     * the mismatch is considered too dangerous. However we may revisit this policy in the future if it appears to be
+     * a compatibility problem. Consequently, no code shall rely on {@code InvalidMarkException} to be thrown.
      *
      * @throws IOException if an I/O error occurs.
      */

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataInput.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataInput.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataInput.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataInput.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -26,6 +26,7 @@ import java.nio.IntBuffer;
 import java.nio.LongBuffer;
 import java.nio.FloatBuffer;
 import java.nio.DoubleBuffer;
+import java.nio.charset.Charset;
 import java.nio.channels.ReadableByteChannel;
 import java.nio.channels.SeekableByteChannel;
 import org.apache.sis.internal.storage.Resources;
@@ -76,7 +77,7 @@ public class ChannelDataInput extends Ch
      * If the buffer already contains some data, then the {@code filled} argument shall be {@code true}.
      * Otherwise (e.g. if it is a newly created buffer), then {@code filled} shall be {@code false}.
      *
-     * @param  filename  a file identifier used only for formatting error message.
+     * @param  filename  a short identifier (typically a filename without path) used for formatting error message.
      * @param  channel   the channel from where data are read.
      * @param  buffer    the buffer where to copy the data.
      * @param  filled    {@code true} if the buffer already contains data, or {@code false} if it needs
@@ -822,7 +823,7 @@ public class ChannelDataInput extends Ch
      * @return the string decoded from the {@code length} next bytes.
      * @throws IOException if an error occurred while reading the bytes, or if the given encoding is invalid.
      */
-    public final String readString(final int length, final String encoding) throws IOException {
+    public final String readString(final int length, final Charset encoding) throws IOException {
         if (buffer.hasArray() && length <= buffer.capacity()) {
             ensureBufferContains(length);
             final int position = buffer.position(); // Must be after 'ensureBufferContains(int)'.
@@ -841,7 +842,7 @@ public class ChannelDataInput extends Ch
      */
     @Override
     public final void seek(final long position) throws IOException {
-        long p = position - bufferOffset;
+        long p = Math.subtractExact(position, bufferOffset);
         if (p >= 0 && p <= buffer.limit()) {
             /*
              * Requested position is inside the current limits of the buffer.
@@ -854,7 +855,7 @@ public class ChannelDataInput extends Ch
              * that StorageConnector.rewind() needs the buffer content to be
              * valid as a result of this seek, so we reload it immediately.
              */
-            ((SeekableByteChannel) channel).position(channelOffset + position);
+            ((SeekableByteChannel) channel).position(Math.addExact(channelOffset, position));
             bufferOffset = position;
             buffer.clear().limit(0);
         } else if (p >= 0) {

Modified: sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataOutput.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataOutput.java?rev=1817597&r1=1817596&r2=1817597&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataOutput.java [UTF-8] (original)
+++ sis/branches/ISO-19115-3/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/io/ChannelDataOutput.java [UTF-8] Sat Dec  9 10:57:44 2017
@@ -607,7 +607,7 @@ public class ChannelDataOutput extends C
      */
     @Override
     public final void seek(final long position) throws IOException {
-        long p = position - bufferOffset;
+        long p = Math.subtractExact(position, bufferOffset);
         if (p >= 0 && p <= buffer.limit()) {
             /*
              * Requested position is inside the current limits of the buffer.
@@ -620,7 +620,7 @@ public class ChannelDataOutput extends C
              * but we can set the new position directly in the channel.
              */
             flush();
-            ((SeekableByteChannel) channel).position(channelOffset + position);
+            ((SeekableByteChannel) channel).position(Math.addExact(channelOffset, position));
             bufferOffset = position;
         } else if (p >= 0) {
             /*



Mime
View raw message