sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jso...@apache.org
Subject svn commit: r1806011 - in /sis/branches/JDK8/storage: sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/ sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/ sis-sto...
Date Thu, 24 Aug 2017 08:56:18 GMT
Author: jsorel
Date: Thu Aug 24 08:56:18 2017
New Revision: 1806011

URL: http://svn.apache.org/viewvc?rev=1806011&view=rev
Log:
Add data store provider opening parameters description

Modified:
    sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
    sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java
    sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
    sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java

Modified: sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -20,6 +20,8 @@ import java.io.Reader;
 import java.io.BufferedReader;
 import java.io.LineNumberReader;
 import java.io.IOException;
+import java.net.URI;
+import org.apache.sis.parameter.Parameters;
 import org.opengis.metadata.Metadata;
 import org.opengis.util.FactoryException;
 import org.apache.sis.storage.DataStore;
@@ -30,6 +32,7 @@ import org.apache.sis.storage.StorageCon
 import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.Resource;
 import org.apache.sis.util.Debug;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -70,6 +73,7 @@ public class LandsatStore extends DataSt
      * The reader, or {@code null} if closed.
      */
     private Reader source;
+    private URI sourceUri;
 
     /**
      * The object returned by {@link #getMetadata()}, created when first needed and cached.
@@ -88,6 +92,11 @@ public class LandsatStore extends DataSt
     public LandsatStore(final LandsatStoreProvider provider, final StorageConnector connector)
throws DataStoreException {
         super(provider, connector);
         source = connector.getStorageAs(Reader.class);
+        try {
+            sourceUri = connector.getStorageAs(URI.class);
+        } catch (IllegalArgumentException ex) {
+            //open parameters will be null.
+        }
         connector.closeAllExcept(source);
         if (source == null) {
             throw new UnsupportedStorageException(super.getLocale(), "Landsat",
@@ -121,6 +130,17 @@ public class LandsatStore extends DataSt
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        if (sourceUri==null) return null;
+        final Parameters parameters = Parameters.castOrWrap(LandsatStoreProvider.OPEN_DESCRIPTOR.createValue());
+        parameters.getOrCreate(LandsatStoreProvider.PARAM_LOCATION).setValue(sourceUri);
+        return parameters;
+    }
+
+    /**
      * Current implementation does not provide any resource yet.
      * Future versions may return an aggregate of all raster data in the GeoTIFF files associated
with this metadata.
      *

Modified: sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.storage.earthobservation;
 
+import java.net.URI;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.storage.DataStoreException;
@@ -24,6 +25,10 @@ import org.apache.sis.storage.ProbeResul
 import org.apache.sis.internal.storage.Capability;
 import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.wkt.FirstKeywordPeek;
+import org.apache.sis.parameter.ParameterBuilder;
+import static org.apache.sis.storage.DataStoreProvider.LOCATION;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 
 
 /**
@@ -41,6 +46,18 @@ import org.apache.sis.internal.storage.w
  */
 @Capabilities(Capability.READ)
 public class LandsatStoreProvider extends DataStoreProvider {
+
+    /**
+     * Landsat location.
+     */
+    static final ParameterDescriptor<URI> PARAM_LOCATION = new ParameterBuilder()
+            .addName(LOCATION)
+            .setRequired(true)
+            .create(URI.class, null);
+
+    static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
+            new ParameterBuilder().addName("Landsat").createGroup(PARAM_LOCATION);
+
     /**
      * The object to use for verifying if the first keyword is the expected one.
      */
@@ -136,6 +153,14 @@ public class LandsatStoreProvider extend
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterDescriptorGroup getOpenParameters() {
+        return OPEN_DESCRIPTOR;
+    }
+
+    /**
      * Returns {@link ProbeResult#SUPPORTED} if the given storage appears to be supported
by {@link LandsatStore}.
      * Returning {@code SUPPORTED} from this method does not guarantee that reading or writing
will succeed, only
      * that there appears to be a reasonable chance of success based on a brief inspection
of the storage header.

Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -18,6 +18,7 @@ package org.apache.sis.storage.geotiff;
 
 import java.util.Locale;
 import java.io.IOException;
+import java.net.URI;
 import java.nio.charset.Charset;
 import java.util.logging.LogRecord;
 import java.nio.charset.StandardCharsets;
@@ -35,9 +36,11 @@ import org.apache.sis.internal.storage.i
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.metadata.sql.MetadataStoreException;
+import org.apache.sis.parameter.Parameters;
 import org.apache.sis.storage.DataStoreClosedException;
 import org.apache.sis.storage.Resource;
 import org.apache.sis.util.resources.Errors;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -61,6 +64,7 @@ public class GeoTiffStore extends DataSt
      * The GeoTIFF reader implementation, or {@code null} if the store has been closed.
      */
     private Reader reader;
+    private URI sourceUri;
 
     /**
      * The metadata, or {@code null} if not yet created.
@@ -89,6 +93,11 @@ public class GeoTiffStore extends DataSt
         }
         connector.closeAllExcept(input);
         try {
+            sourceUri = connector.getStorageAs(URI.class);
+        } catch (IllegalArgumentException ex) {
+            //open parameters will be null.
+        }
+        try {
             reader = new Reader(this, input);
         } catch (IOException e) {
             throw new DataStoreException(e);
@@ -133,6 +142,17 @@ public class GeoTiffStore extends DataSt
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        if (sourceUri==null) return null;
+        final Parameters parameters = Parameters.castOrWrap(GeoTiffStoreProvider.OPEN_DESCRIPTOR.createValue());
+        parameters.getOrCreate(GeoTiffStoreProvider.PARAM_LOCATION).setValue(sourceUri);
+        return parameters;
+    }
+
+    /**
      * Current implementation does not provide any resource yet.
      * A future version will return the raster data in a coverage resource.
      *

Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.storage.geotiff;
 
+import java.net.URI;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import org.apache.sis.util.Version;
@@ -27,6 +28,10 @@ import org.apache.sis.storage.StorageCon
 import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.Capability;
 import org.apache.sis.internal.util.Constants;
+import org.apache.sis.parameter.ParameterBuilder;
+import static org.apache.sis.storage.DataStoreProvider.LOCATION;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 
 
 /**
@@ -47,6 +52,18 @@ import org.apache.sis.internal.util.Cons
  */
 @Capabilities(Capability.READ)
 public class GeoTiffStoreProvider extends DataStoreProvider {
+
+    /**
+     * Geotiff location.
+     */
+    static final ParameterDescriptor<URI> PARAM_LOCATION = new ParameterBuilder()
+            .addName(LOCATION)
+            .setRequired(true)
+            .create(URI.class, null);
+
+    static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
+            new ParameterBuilder().addName(Constants.GEOTIFF).createGroup(PARAM_LOCATION);
+
     /**
      * The MIME type for GeoTIFF files.
      */
@@ -74,6 +91,14 @@ public class GeoTiffStoreProvider extend
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterDescriptorGroup getOpenParameters() {
+        return OPEN_DESCRIPTOR;
+    }
+
+    /**
      * Returns {@link ProbeResult#SUPPORTED} if the given storage appears to be supported
by {@link GeoTiffStore}.
      * Returning {@code SUPPORTED} from this method does not guarantee that reading or writing
will succeed,
      * only that there appears to be a reasonable chance of success based on a brief inspection
of the

Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -17,6 +17,7 @@
 package org.apache.sis.storage.netcdf;
 
 import java.io.IOException;
+import java.net.URI;
 import org.opengis.metadata.Metadata;
 import org.apache.sis.util.Debug;
 import org.apache.sis.storage.DataStore;
@@ -25,10 +26,12 @@ import org.apache.sis.storage.Unsupporte
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.metadata.ModifiableMetadata;
+import org.apache.sis.parameter.Parameters;
 import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.Resource;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Version;
+import org.opengis.parameter.ParameterValueGroup;
 import ucar.nc2.constants.CDM;
 
 
@@ -50,6 +53,7 @@ public class NetcdfStore extends DataSto
      * depending on whether we are using the embedded SIS decoder or a wrapper around the
UCAR library.
      */
     private final Decoder decoder;
+    private URI sourceUri;
 
     /**
      * The object returned by {@link #getMetadata()}, created when first needed and cached.
@@ -85,6 +89,11 @@ public class NetcdfStore extends DataSto
     public NetcdfStore(final NetcdfStoreProvider provider, final StorageConnector connector)
throws DataStoreException {
         super(provider, connector);
         try {
+            sourceUri = connector.getStorageAs(URI.class);
+        } catch (IllegalArgumentException ex) {
+            //open parameters will be null.
+        }
+        try {
             decoder = NetcdfStoreProvider.decoder(listeners, connector);
         } catch (IOException e) {
             throw new DataStoreException(e);
@@ -118,6 +127,17 @@ public class NetcdfStore extends DataSto
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        if (sourceUri==null) return null;
+        final Parameters parameters = Parameters.castOrWrap(NetcdfStoreProvider.OPEN_DESCRIPTOR.createValue());
+        parameters.getOrCreate(NetcdfStoreProvider.PARAM_LOCATION).setValue(sourceUri);
+        return parameters;
+    }
+
+    /**
      * This implementation does not provide any resource yet.
      *
      * @return currently {@code null} (will be implemented in future Apache SIS version).

Modified: sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -26,6 +26,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.UndeclaredThrowableException;
+import java.net.URI;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.internal.netcdf.Resources;
 import org.apache.sis.internal.netcdf.impl.ChannelDecoder;
@@ -35,6 +36,7 @@ import org.apache.sis.internal.storage.C
 import org.apache.sis.internal.storage.Capability;
 import org.apache.sis.internal.system.SystemListener;
 import org.apache.sis.internal.system.Modules;
+import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.storage.StorageConnector;
@@ -43,6 +45,8 @@ import org.apache.sis.storage.ProbeResul
 import org.apache.sis.util.logging.WarningListeners;
 import org.apache.sis.util.logging.Logging;
 import org.apache.sis.util.Version;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 
 
 /**
@@ -66,6 +70,18 @@ import org.apache.sis.util.Version;
  */
 @Capabilities(Capability.READ)
 public class NetcdfStoreProvider extends DataStoreProvider {
+
+    /**
+     * NetCDF location.
+     */
+    static final ParameterDescriptor<URI> PARAM_LOCATION = new ParameterBuilder()
+            .addName(LOCATION)
+            .setRequired(true)
+            .create(URI.class, null);
+
+    static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
+            new ParameterBuilder().addName("NetCDF").createGroup(PARAM_LOCATION);
+
     /**
      * The MIME type for NetCDF files.
      */
@@ -130,6 +146,14 @@ public class NetcdfStoreProvider extends
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterDescriptorGroup getOpenParameters() {
+        return OPEN_DESCRIPTOR;
+    }
+
+    /**
      * Returns {@link ProbeResult#SUPPORTED} if the given storage appears to be supported
by {@link NetcdfStore}.
      * Returning {@code SUPPORTED} from this method does not guarantee that reading or writing
will succeed,
      * only that there appears to be a reasonable chance of success based on a brief inspection
of the

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -68,10 +68,12 @@ import java.time.Instant;
 import java.time.DateTimeException;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
+import org.apache.sis.parameter.Parameters;
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
 import org.opengis.feature.PropertyType;
 import org.opengis.feature.AttributeType;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -134,6 +136,7 @@ public final class Store extends DataSto
      * @see #readLine()
      */
     private BufferedReader source;
+    private URI sourceUri;
 
     /**
      * The character encoding, or {@code null} if unspecified (in which case the platform
default is assumed).
@@ -229,6 +232,11 @@ public final class Store extends DataSto
     {
         super(provider, connector);
         final Reader r = connector.getStorageAs(Reader.class);
+        try {
+            sourceUri = connector.getStorageAs(URI.class);
+        } catch (IllegalArgumentException ex) {
+            //open parameters will be null.
+        }
         connector.closeAllExcept(r);
         if (r == null) {
             throw new DataStoreException(Errors.format(Errors.Keys.CanNotOpen_1, super.getDisplayName()));
@@ -619,6 +627,17 @@ public final class Store extends DataSto
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        if (sourceUri==null) return null;
+        final Parameters parameters = Parameters.castOrWrap(StoreProvider.OPEN_DESCRIPTOR.createValue());
+        parameters.getOrCreate(StoreProvider.PARAM_LOCATION).setValue(sourceUri);
+        return parameters;
+    }
+
+    /**
      * Returns the {@code FeatureSet} from which all features in this data store can be accessed.
      *
      * @return the starting point of all features in this data store.

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/StoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.storage.csv;
 
+import java.net.URI;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreProvider;
@@ -24,6 +25,10 @@ import org.apache.sis.storage.StorageCon
 import org.apache.sis.internal.storage.Capability;
 import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.wkt.FirstKeywordPeek;
+import org.apache.sis.parameter.ParameterBuilder;
+import static org.apache.sis.storage.DataStoreProvider.LOCATION;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 
 
 /**
@@ -41,6 +46,18 @@ import org.apache.sis.internal.storage.w
  */
 @Capabilities(Capability.READ)
 public final class StoreProvider extends DataStoreProvider {
+
+    /**
+     * CSV source.
+     */
+    static final ParameterDescriptor<URI> PARAM_LOCATION = new ParameterBuilder()
+            .addName(LOCATION)
+            .setRequired(true)
+            .create(URI.class, null);
+
+    static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
+            new ParameterBuilder().addName("CSV").createGroup(PARAM_LOCATION);
+
     /**
      * The format names for static features and moving features.
      */
@@ -117,6 +134,14 @@ public final class StoreProvider extends
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterDescriptorGroup getOpenParameters() {
+        return OPEN_DESCRIPTOR;
+    }
+
+    /**
      * Returns {@link ProbeResult#SUPPORTED} if the given storage appears to be supported
by CSV {@link Store}.
      * Returning {@code SUPPORTED} from this method does not guarantee that reading or writing
will succeed, only
      * that there appears to be a reasonable chance of success based on a brief inspection
of the storage header.

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -23,6 +23,7 @@ import java.util.logging.Level;
 import java.util.logging.LogRecord;
 import java.io.Reader;
 import java.io.IOException;
+import java.net.URI;
 import java.text.ParsePosition;
 import java.text.ParseException;
 import org.opengis.metadata.Metadata;
@@ -40,8 +41,10 @@ import org.apache.sis.storage.DataStoreE
 import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.internal.referencing.DefinitionVerifier;
 import org.apache.sis.internal.storage.MetadataBuilder;
+import org.apache.sis.parameter.Parameters;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.CharSequences;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -64,6 +67,7 @@ final class Store extends DataStore {
      * The reader, set by the constructor and cleared when no longer needed.
      */
     private Reader source;
+    private URI sourceUri;
 
     /**
      * The parsed objects, filled only when first needed.
@@ -87,6 +91,11 @@ final class Store extends DataStore {
         super(provider, connector);
         objects = new ArrayList<>();
         source  = connector.getStorageAs(Reader.class);
+        try {
+            sourceUri = connector.getStorageAs(URI.class);
+        } catch (IllegalArgumentException ex) {
+            //open parameters will be null.
+        }
         connector.closeAllExcept(source);
         if (source == null) {
             throw new DataStoreException(Errors.format(Errors.Keys.CanNotOpen_1, super.getDisplayName()));
@@ -194,6 +203,17 @@ final class Store extends DataStore {
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        if (sourceUri==null) return null;
+        final Parameters parameters = Parameters.castOrWrap(StoreProvider.OPEN_DESCRIPTOR.createValue());
+        parameters.getOrCreate(StoreProvider.PARAM_LOCATION).setValue(sourceUri);
+        return parameters;
+    }
+
+    /**
      * There is currently no resource associated to Well Known Text format since we parse
only CRS.
      * Future versions may return resources if we parse also geometries.
      */

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/StoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.storage.wkt;
 
+import java.net.URI;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
@@ -27,7 +28,10 @@ import org.apache.sis.storage.ProbeResul
 import org.apache.sis.internal.storage.Capability;
 import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.metadata.WKTKeywords;
+import org.apache.sis.parameter.ParameterBuilder;
 import org.apache.sis.util.Version;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 
 
 /**
@@ -40,6 +44,18 @@ import org.apache.sis.util.Version;
  */
 @Capabilities(Capability.READ)
 public final class StoreProvider extends DataStoreProvider {
+
+    /**
+     * WKT source.
+     */
+    static final ParameterDescriptor<URI> PARAM_LOCATION = new ParameterBuilder()
+            .addName(LOCATION)
+            .setRequired(true)
+            .create(URI.class, null);
+
+    static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
+            new ParameterBuilder().addName("WKT").createGroup(PARAM_LOCATION);
+
     /**
      * The {@value} MIME type.
      */
@@ -156,6 +172,14 @@ public final class StoreProvider extends
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterDescriptorGroup getOpenParameters() {
+        return OPEN_DESCRIPTOR;
+    }
+
+    /**
      * Returns {@link ProbeResult#SUPPORTED} if the given storage appears to be supported
by WKT {@link Store}.
      * Returning {@code SUPPORTED} from this method does not guarantee that reading or writing
will succeed,
      * only that there appears to be a reasonable chance of success based on a brief inspection
of the storage

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -23,6 +23,7 @@ import java.io.Closeable;
 import java.io.Reader;
 import java.io.InputStream;
 import java.io.IOException;
+import java.net.URI;
 import javax.xml.bind.JAXBException;
 import javax.xml.transform.stream.StreamSource;
 import org.opengis.metadata.Metadata;
@@ -40,6 +41,8 @@ import org.apache.sis.util.resources.Err
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.referencing.DefinitionVerifier;
+import org.apache.sis.parameter.Parameters;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -64,6 +67,7 @@ final class Store extends DataStore {
      * The input stream or reader, set by the constructor and cleared when no longer needed.
      */
     private StreamSource source;
+    private URI sourceUri;
 
     /**
      * The unmarshalled object, initialized only when first needed.
@@ -86,6 +90,11 @@ final class Store extends DataStore {
     public Store(final StoreProvider provider, final StorageConnector connector) throws DataStoreException
{
         super(provider, connector);
         final InputStream in = connector.getStorageAs(InputStream.class);
+        try {
+            sourceUri = connector.getStorageAs(URI.class);
+        } catch (IllegalArgumentException ex) {
+            //open parameters will be null.
+        }
         if (in != null) {
             source = new StreamSource(in);
         } else {
@@ -209,6 +218,17 @@ final class Store extends DataStore {
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        if (sourceUri==null) return null;
+        final Parameters parameters = Parameters.castOrWrap(StoreProvider.OPEN_DESCRIPTOR.createValue());
+        parameters.getOrCreate(StoreProvider.PARAM_LOCATION).setValue(sourceUri);
+        return parameters;
+    }
+
+    /**
      * Current implementation does not provide any resource since it is only about metadata.
      * Futures versions may return resources if Apache SIS provides a wider GML support.
      */

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/StoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -16,12 +16,16 @@
  */
 package org.apache.sis.internal.storage.xml;
 
+import java.net.URI;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.Capability;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 
 
 /**
@@ -34,6 +38,18 @@ import org.apache.sis.internal.storage.C
  */
 @Capabilities(Capability.READ)
 public final class StoreProvider extends AbstractProvider {
+
+    /**
+     * XML source.
+     */
+    static final ParameterDescriptor<URI> PARAM_LOCATION = new ParameterBuilder()
+            .addName(LOCATION)
+            .setRequired(true)
+            .create(URI.class, null);
+
+    static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
+            new ParameterBuilder().addName("XML").createGroup(PARAM_LOCATION);
+
     /**
      * Creates a new provider.
      */
@@ -56,6 +72,14 @@ public final class StoreProvider extends
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterDescriptorGroup getOpenParameters() {
+        return OPEN_DESCRIPTOR;
+    }
+
+    /**
      * Returns a {@link Store} implementation associated with this provider.
      *
      * @param  connector  information about the storage (URL, stream, <i>etc</i>).

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -28,6 +28,7 @@ import org.apache.sis.util.logging.Warni
 import org.apache.sis.util.logging.WarningListeners;
 import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.internal.util.Citations;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -169,6 +170,21 @@ public abstract class DataStore implemen
     }
 
     /**
+     * Returns the parameters used to open this data store.
+     * The description of those parameters are defined by {@link DataStoreProvider#getOpenParameters()
}.
+     *
+     * <p>In the event a store must be closed and reopened later. Those parameters
+     * can be stored in a file or database and used to create a new store later.</p>
+     *
+     * <p>In some cases, for store created with data in memory or with initialization
+     * parameters to complex to be expressed as a ParameterValueGroup, this methid may
+     * return null.</p>
+     *
+     * @return parameters used when opening this {@link org.apache.sis.storage.DataStore}
or null.
+     */
+    public abstract ParameterValueGroup getOpenParameters();
+
+    /**
      * Returns information about the data store as a whole. The returned metadata object
can contain
      * information such as the spatiotemporal extent of all contained {@linkplain Resource
resources},
      * contact information about the creator or distributor, data quality, update frequency,
usage constraints,

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -21,7 +21,12 @@ import org.apache.sis.internal.simple.Si
 import org.apache.sis.metadata.iso.citation.DefaultCitation;
 import org.apache.sis.metadata.iso.distribution.DefaultFormat;
 import org.apache.sis.measure.Range;
+import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Version;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.parameter.ParameterNotFoundException;
+import org.opengis.parameter.ParameterValue;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -57,6 +62,19 @@ import org.apache.sis.util.Version;
  * @module
  */
 public abstract class DataStoreProvider {
+
+    /**
+     * Name of the parameter used to create StorageConnector instances.
+     *
+     * <p>Implementors are encouraged to define a parameter with this name
+     * to ensure a common and consistent definition among providers.
+     * The parameter should be defined as mandatory and declared with a
+     * very common java class such as URI, Path, stream, JDBC connection, <i>etc</i>.
+     * </p>
+     */
+    public static final String LOCATION = "location";
+
+
     /**
      * Creates a new provider.
      */
@@ -130,6 +148,22 @@ public abstract class DataStoreProvider
     }
 
     /**
+     * Returns a description of all opening parameters accepted by this provider.
+     *
+     * <p>Implementors are responsible for declaring all parameters and there mandatory
states.
+     * It is recommended to use at least the LOCATION parameter name. This parameter will
+     * be recognized by the default datastore provider methods and used whenever a
+     * {@link StorageConnector} is required.</p>
+     *
+     * <p>This description can be used to dynamically generate user configuration interfaces
+     * and provide fine grain control over the store general behavior such as caching,
+     * time-outs, encoding, <i>etc</i>.</p>
+     *
+     * @return Description of the parameters required for opening a {@link org.apache.sis.storage.DataStore}.
+     */
+    public abstract ParameterDescriptorGroup getOpenParameters();
+
+    /**
      * Indicates if the given storage appears to be supported by the {@code DataStore}s created
by this provider.
      * The most typical return values are:
      *
@@ -199,4 +233,35 @@ public abstract class DataStoreProvider
      * @see DataStores#open(Object)
      */
     public abstract DataStore open(StorageConnector connector) throws DataStoreException;
+
+    /**
+     * Returns a data store implementation associated with this provider.
+     *
+     * <div class="section">Implementation note</div>
+     * Implementors shall invoke {@link StorageConnector#closeAllExcept(Object)} after {@code
DataStore}
+     * creation, keeping open only the needed resource.
+     *
+     * <div class="section">Implementation note</div>
+     * The default implementation of this method searches for the {@link #LOCATION} parameter
+     * to create a StorageConnector which is then passed to {@link #open(org.apache.sis.storage.StorageConnector)
}.
+     *
+     * @param  parameters opening parameters as defined by {@link #getOpenParameters() }
+     * @return a data store implementation associated with this provider for the given storage.
+     * @throws DataStoreException if an error occurred while creating the data store instance.
+     *
+     * @see DataStores#open(Object)
+     */
+    public DataStore open(ParameterValueGroup parameters) throws DataStoreException {
+        ArgumentChecks.ensureNonNull("parameter", parameters);
+
+        final ParameterValue<?> locationParameter;
+        try {
+            locationParameter = parameters.parameter(LOCATION);
+        } catch (ParameterNotFoundException ex) {
+            throw new DataStoreException("Location parameter not defined.",ex);
+        }
+        final StorageConnector connector = new StorageConnector(locationParameter.getValue());
+        return open(connector);
+    }
+
 }

Modified: sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -17,6 +17,7 @@
 package org.apache.sis.storage;
 
 import org.opengis.metadata.Metadata;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -58,6 +59,11 @@ final strictfp class DataStoreMock exten
         return null;
     }
 
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        return null;
+    }
+
     @Override
     public void close() {
     }

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/Store.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -43,8 +43,10 @@ import org.apache.sis.metadata.iso.distr
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
 import java.io.UncheckedIOException;
+import org.apache.sis.parameter.Parameters;
 import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
+import org.opengis.parameter.ParameterValueGroup;
 
 
 /**
@@ -168,6 +170,17 @@ public final class Store extends StaxDat
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterValueGroup getOpenParameters() {
+        if (sourceUri==null) return null;
+        final Parameters parameters = Parameters.castOrWrap(StoreProvider.OPEN_DESCRIPTOR.createValue());
+        parameters.getOrCreate(StoreProvider.PARAM_LOCATION).setValue(sourceUri);
+        return parameters;
+    }
+
+    /**
      * Returns the {@code FeatureSet} from which all features in this data store can be accessed.
      *
      * @return the starting point of all features in this data store.

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -16,6 +16,7 @@
  */
 package org.apache.sis.internal.storage.gpx;
 
+import java.net.URI;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import org.apache.sis.storage.DataStore;
@@ -25,7 +26,11 @@ import org.apache.sis.internal.storage.C
 import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.xml.stream.StaxDataStoreProvider;
 import org.apache.sis.measure.Range;
+import org.apache.sis.parameter.ParameterBuilder;
+import static org.apache.sis.storage.DataStoreProvider.LOCATION;
 import org.apache.sis.util.Version;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
 
 
 /**
@@ -41,6 +46,16 @@ import org.apache.sis.util.Version;
 @Capabilities({Capability.READ, Capability.WRITE})
 public final class StoreProvider extends StaxDataStoreProvider {
     /**
+     * XML source.
+     */
+    static final ParameterDescriptor<URI> PARAM_LOCATION = new ParameterBuilder()
+            .addName(LOCATION)
+            .setRequired(true)
+            .create(URI.class, null);
+
+    static final ParameterDescriptorGroup OPEN_DESCRIPTOR =
+            new ParameterBuilder().addName("GPX").createGroup(PARAM_LOCATION);
+    /**
      * The "1.0" version.
      */
     static final Version V1_0 = Version.valueOf(1,0);
@@ -75,6 +90,14 @@ public final class StoreProvider extends
     }
 
     /**
+     * {@inheritDoc }
+     */
+    @Override
+    public ParameterDescriptorGroup getOpenParameters() {
+        return OPEN_DESCRIPTOR;
+    }
+
+    /**
      * Returns a GPX {@link Store} implementation associated with this provider.
      *
      * @param  connector  information about the storage (URL, stream, <i>etc</i>).

Modified: sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java?rev=1806011&r1=1806010&r2=1806011&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/xml/stream/StaxDataStore.java
[UTF-8] Thu Aug 24 08:56:18 2017
@@ -23,6 +23,7 @@ import java.util.logging.LogRecord;
 import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.URI;
 import java.nio.file.Path;
 import java.nio.charset.Charset;
 import java.nio.file.StandardOpenOption;
@@ -114,6 +115,7 @@ public abstract class StaxDataStore exte
      * @see StorageConnector#getStorage()
      */
     private Object storage;
+    protected URI sourceUri;
 
     /**
      * The underlying stream to close when this {@code StaxDataStore} is closed, or {@code
null} if none.
@@ -230,6 +232,11 @@ public abstract class StaxDataStore exte
             stream = (AutoCloseable) storage;
         }
         channelFactory = connector.getStorageAs(ChannelFactory.class);  // Must be last before
'closeAllExcept'.
+        try {
+            sourceUri = connector.getStorageAs(URI.class);
+        } catch (IllegalArgumentException ex) {
+            //open parameters will be null.
+        }
         connector.closeAllExcept(stream);
         /*
          * If possible, remember the position where data begin in the stream in order to
allow reading



Mime
View raw message