sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1778495 - in /sis/branches/JDK8: core/sis-utility/src/main/java/org/apache/sis/setup/ core/sis-utility/src/main/java/org/apache/sis/util/resources/ storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/ storag...
Date Fri, 13 Jan 2017 05:52:02 GMT
Author: desruisseaux
Date: Fri Jan 13 05:52:02 2017
New Revision: 1778495

URL: http://svn.apache.org/viewvc?rev=1778495&view=rev
Log:
Provide a mechanism for allowing DataStoreProvider to specify whether they support write operations.
The mechanism provided in this commit (based on an annotation) will probably need to be revisited
in a future version, so we keep it in internal package for now.

Modified:
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
    sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
    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/GeoTiffStoreProvider.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/StoreProvider.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/StoreProvider.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStores.java
    sis/branches/JDK8/storage/sis-xmlstore/src/main/java/org/apache/sis/internal/storage/gpx/StoreProvider.java

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java?rev=1778495&r1=1778494&r2=1778495&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java [UTF-8]
(original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/About.java [UTF-8]
Fri Jan 13 05:52:02 2017
@@ -22,7 +22,6 @@ import java.util.Set;
 import java.util.EnumSet;
 import java.util.Map;
 import java.util.LinkedHashMap;
-import java.util.Collection;
 import java.util.Iterator;
 import java.util.Locale;
 import java.util.Date;
@@ -42,8 +41,6 @@ import java.nio.file.Path;
 import java.nio.charset.Charset;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
-import org.opengis.metadata.citation.Citation;
-import org.opengis.util.InternationalString;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Version;
@@ -328,19 +325,11 @@ fill:   for (int i=0; ; i++) {
                 case 9: {
                     newSection = PLUGINS;
                     if (sections.contains(PLUGINS)) try {
-                        final Collection<?> formats = (Collection<?>) Class.forName("org.apache.sis.storage.DataStores")
-                                                          .getMethod("formats", (Class[])
null).invoke((Object[]) null);
-                        final int count = formats.size();
-                        children = new String[count * 2];
-                        final String read = resources.getString(Vocabulary.Keys.Read);
-                        int j = 0;
-                        for (final Object f : formats) {
-                            children[j++] = read;
-                            children[j++] = titleAndName(((org.opengis.metadata.distribution.Format)
f).getFormatSpecificationCitation(), locale);
-                        }
-                        value = resources.getString(Vocabulary.Keys.EntryCount_1, count);
+                        children = (String[]) Class.forName("org.apache.sis.internal.storage.Capability")
+                                .getMethod("providers", Locale.class, Vocabulary.class).invoke(null,
locale, resources);
+                        value = resources.getString(Vocabulary.Keys.EntryCount_1, children.length
/ 2);
                     } catch (ClassNotFoundException e) {
-                        // sis-storage module not in the classpath - ignore.
+                        recoverableException(Modules.STORAGE, e);       // sis-storage module
not in the classpath.
                     } catch (ReflectiveOperationException e) {
                         value = e.toString();
                     }
@@ -531,33 +520,6 @@ pathTree:   for (int j=0; ; j++) {
     }
 
     /**
-     * Returns the title or alternate title of the given citation, or "untitled" if none.
-     *
-     * @param  pt  {@code true} for preferring the title over alternate titles, or {@code
false} for the opposite.
-     */
-    private static InternationalString title(final Citation ci, final boolean pt) {
-        final InternationalString title = ci.getTitle();
-        if (pt && title != null) return title;
-        for (final InternationalString t : ci.getAlternateTitles()) {
-            if (t != null) return t;
-        }
-        if (title != null) return title;
-        return Vocabulary.formatInternational(Vocabulary.Keys.Untitled);
-    }
-
-    /**
-     * Returns the title together with the abbreviation in parenthesis, if it exists and
is different than the title.
-     */
-    private static String titleAndName(final Citation ci, final Locale locale) {
-        String title = title(ci, true).toString(locale);
-        final String abbreviation = title(ci, false).toString(locale);
-        if (!abbreviation.equals(title)) {
-            title = title + " (" + abbreviation + ')';
-        }
-        return title;
-    }
-
-    /**
      * Returns a map of all JAR files or class directories found in the given paths,
      * associated to a description obtained from their {@code META-INF/MANIFEST.MF}.
      *
@@ -778,7 +740,7 @@ pathTree:   for (int j=0; ; j++) {
         try {
             return country ? locale.getCountry() : locale.getISO3Language();
         } catch (MissingResourceException e) {
-            Logging.recoverableException(Logging.getLogger(Loggers.LOCALIZATION), About.class,
"configuration", e);
+            recoverableException(Loggers.LOCALIZATION, e);
             return null;
         }
     }
@@ -828,4 +790,11 @@ pathTree:   for (int j=0; ; j++) {
         }
         return new File(parent, file.getName());
     }
+
+    /**
+     * Logs a recoverable exception that happened (directly or indirectly) in the {@link
#configuration()} method.
+     */
+    private static void recoverableException(final String logger, final Exception e) {
+        Logging.recoverableException(Logging.getLogger(logger), About.class, "configuration",
e);
+    }
 }

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java?rev=1778495&r1=1778494&r2=1778495&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.java
[UTF-8] Fri Jan 13 05:52:02 2017
@@ -492,6 +492,11 @@ public final class Vocabulary extends In
         public static final short Others = 85;
 
         /**
+         * {0} ({1})
+         */
+        public static final short Parenthesis_2 = 126;
+
+        /**
          * Paths
          */
         public static final short Paths = 86;
@@ -537,6 +542,11 @@ public final class Vocabulary extends In
         public static final short Scale = 92;
 
         /**
+         * {0}/{1}
+         */
+        public static final short SlashSeparatedList_2 = 124;
+
+        /**
          * Source
          */
         public static final short Source = 93;
@@ -612,6 +622,11 @@ public final class Vocabulary extends In
         public static final short Units = 107;
 
         /**
+         * Unknown
+         */
+        public static final short Unknown = 125;
+
+        /**
          * Unnamed
          */
         public static final short Unnamed = 108;

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties?rev=1778495&r1=1778494&r2=1778495&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary.properties
[ISO-8859-1] Fri Jan 13 05:52:02 2017
@@ -101,6 +101,7 @@ Optional                = Optional
 Options                 = Options
 Others                  = Others
 OtherSurface            = Other surface
+Parenthesis_2           = {0} ({1})
 Paths                   = Paths
 Plugins                 = Plug-ins
 Quoted_1                = \u201c{0}\u201d
@@ -110,6 +111,7 @@ RemoteConfiguration     = Remote configu
 Root                    = Root
 RootMeanSquare          = Root Mean Square
 Scale                   = Scale
+SlashSeparatedList_2    = {0}/{1}
 Source                  = Source
 StandardDeviation       = Standard deviation
 SubsetOf_1              = Subset of {0}
@@ -123,6 +125,7 @@ Transformation          = Transformation
 TransformationAccuracy  = Transformation accuracy
 TruncatedJulian         = Truncated Julian
 Type                    = Type
+Unknown                 = Unknown
 Unnamed                 = Unnamed
 Untitled                = Untitled
 UnavailableContent      = Unavailable content.

Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1778495&r1=1778494&r2=1778495&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] Fri Jan 13 05:52:02 2017
@@ -108,6 +108,7 @@ Optional                = Optionnel
 Options                 = Options
 Others                  = Autres
 OtherSurface            = Autre surface
+Parenthesis_2           = {0} ({1})
 Paths                   = Chemins
 Plugins                 = Modules d\u2019extension
 Quoted_1                = \u00ab\u202f{0}\u202f\u00bb
@@ -117,6 +118,7 @@ RemoteConfiguration     = Configuration
 Root                    = Racine
 RootMeanSquare          = Moyenne quadratique
 Scale                   = \u00c9chelle
+SlashSeparatedList_2    = {0}/{1}
 Source                  = Source
 StandardDeviation       = \u00c9cart type
 SubsetOf_1              = Sous-ensemble de {0}
@@ -130,6 +132,7 @@ Transformation          = Transformation
 TransformationAccuracy  = Pr\u00e9cision de la transformation
 TruncatedJulian         = Julien tronqu\u00e9
 Type                    = Type
+Unknown                 = Inconnu
 Unnamed                 = Sans nom
 Untitled                = Sans titre
 UnavailableContent      = Contenu non-disponible.

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=1778495&r1=1778494&r2=1778495&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] Fri Jan 13 05:52:02 2017
@@ -21,6 +21,8 @@ import org.apache.sis.storage.DataStoreP
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.ProbeResult;
+import org.apache.sis.internal.storage.Capability;
+import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.wkt.FirstKeywordPeek;
 
 
@@ -37,6 +39,7 @@ import org.apache.sis.internal.storage.w
  * @version 0.8
  * @module
  */
+@Capabilities(Capability.READ)
 public class LandsatStoreProvider extends DataStoreProvider {
     /**
      * The object to use for verifying if the first keyword is the expected one.

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=1778495&r1=1778494&r2=1778495&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] Fri Jan 13 05:52:02 2017
@@ -24,6 +24,8 @@ import org.apache.sis.storage.DataStoreE
 import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.storage.ProbeResult;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.internal.storage.Capabilities;
+import org.apache.sis.internal.storage.Capability;
 
 
 /**
@@ -41,6 +43,7 @@ import org.apache.sis.storage.StorageCon
  *
  * @see GeoTiffStore
  */
+@Capabilities(Capability.READ)
 public class GeoTiffStoreProvider extends DataStoreProvider {
     /**
      * The MIME type for GeoTIFF files.

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=1778495&r1=1778494&r2=1778495&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] Fri Jan 13 05:52:02 2017
@@ -28,6 +28,8 @@ import org.apache.sis.internal.netcdf.De
 import org.apache.sis.internal.netcdf.impl.ChannelDecoder;
 import org.apache.sis.internal.netcdf.ucar.DecoderWrapper;
 import org.apache.sis.internal.storage.io.ChannelDataInput;
+import org.apache.sis.internal.storage.Capabilities;
+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.storage.DataStore;
@@ -53,11 +55,12 @@ import org.apache.sis.util.Version;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.4
+ * @version 0.8
  * @module
  *
  * @see NetcdfStore
  */
+@Capabilities(Capability.READ)
 public class NetcdfStoreProvider extends DataStoreProvider {
     /**
      * The MIME type for NetCDF files.

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=1778495&r1=1778494&r2=1778495&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] Fri Jan 13 05:52:02 2017
@@ -21,6 +21,8 @@ import org.apache.sis.storage.DataStoreE
 import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.storage.ProbeResult;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.internal.storage.Capability;
+import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.wkt.FirstKeywordPeek;
 
 
@@ -37,6 +39,7 @@ import org.apache.sis.internal.storage.w
  * @version 0.8
  * @module
  */
+@Capabilities(Capability.READ)
 public final class StoreProvider extends DataStoreProvider {
     /**
      * The object to use for verifying if the first keyword is the expected one.

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=1778495&r1=1778494&r2=1778495&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] Fri Jan 13 05:52:02 2017
@@ -24,6 +24,8 @@ import org.apache.sis.storage.DataStoreP
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.ProbeResult;
+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.util.Version;
 
@@ -36,6 +38,7 @@ import org.apache.sis.util.Version;
  * @version 0.8
  * @module
  */
+@Capabilities(Capability.READ)
 public final class StoreProvider extends DataStoreProvider {
     /**
      * The {@value} MIME type.

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=1778495&r1=1778494&r2=1778495&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] Fri Jan 13 05:52:02 2017
@@ -20,6 +20,8 @@ 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;
 
 
 /**
@@ -30,6 +32,7 @@ import org.apache.sis.storage.StorageCon
  * @version 0.8
  * @module
  */
+@Capabilities(Capability.READ)
 public final class StoreProvider extends AbstractProvider {
     /**
      * Creates a new provider.

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java?rev=1778495&r1=1778494&r2=1778495&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreRegistry.java
[UTF-8] Fri Jan 13 05:52:02 2017
@@ -21,7 +21,6 @@ import java.util.LinkedList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.ServiceLoader;
-import org.opengis.metadata.distribution.Format;
 import org.apache.sis.internal.storage.Resources;
 import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.internal.util.LazySet;
@@ -55,11 +54,6 @@ final class DataStoreRegistry {
     private final ServiceLoader<DataStoreProvider> loader;
 
     /**
-     * Immutable set of available formats, created when first needed.
-     */
-    private Collection<Format> formats;
-
-    /**
      * Creates a new registry which will look for data stores accessible to the default class
loader.
      * The default is the current thread {@linkplain Thread#getContextClassLoader() context
class loader},
      * provided that it can access at least the Apache SIS stores.
@@ -79,6 +73,33 @@ final class DataStoreRegistry {
     }
 
     /**
+     * Returns the list of data store providers available at this method invocation time.
+     * More providers may be added later if new modules are added on the classpath.
+     *
+     * @return descriptions of available data stores.
+     *
+     * @since 0.8
+     */
+    public Collection<DataStoreProvider> providers() {
+        synchronized (loader) {
+            final Iterator<DataStoreProvider> providers = loader.iterator();
+            return new LazySet<>(new Iterator<DataStoreProvider>() {
+                @Override public boolean hasNext() {
+                    synchronized (loader) {
+                        return providers.hasNext();
+                    }
+                }
+
+                @Override public DataStoreProvider next() {
+                    synchronized (loader) {
+                        return providers.next();
+                    }
+                }
+            });
+        }
+    }
+
+    /**
      * Returns the MIME type of the storage file format, or {@code null} if unknown or not
applicable.
      *
      * @param  storage  the input/output object as a URL, file, image input stream, <i>etc.</i>.
@@ -224,37 +245,4 @@ search:         while (!deferred.isEmpty
         }
         return selected;
     }
-
-    /**
-     * Returns the list of data formats available at this method invocation time.
-     * More data may be added later if new modules are added on the classpath.
-     *
-     * @return descriptions of available data formats.
-     *
-     * @since 0.8
-     */
-    @SuppressWarnings("ReturnOfCollectionOrArrayField")
-    public Collection<Format> formats() {
-        synchronized (loader) {
-            if (formats == null) {
-                final Iterator<DataStoreProvider> providers = loader.iterator();
-                formats = new LazySet<>(new Iterator<Format>() {
-                    @Override public boolean hasNext() {
-                        synchronized (loader) {
-                            return providers.hasNext();
-                        }
-                    }
-
-                    @Override public Format next() {
-                        final DataStoreProvider provider;
-                        synchronized (loader) {
-                            provider = providers.next();
-                        }
-                        return provider.getFormat();
-                    }
-                });
-            }
-            return formats;
-        }
-    }
 }

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStores.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStores.java?rev=1778495&r1=1778494&r2=1778495&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStores.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStores.java
[UTF-8] Fri Jan 13 05:52:02 2017
@@ -17,7 +17,6 @@
 package org.apache.sis.storage;
 
 import java.util.Collection;
-import org.opengis.metadata.distribution.Format;
 import org.apache.sis.util.Static;
 import org.apache.sis.internal.system.Modules;
 import org.apache.sis.internal.system.SystemListener;
@@ -80,6 +79,18 @@ public final class DataStores extends St
     }
 
     /**
+     * Returns the list of data store providers available at this method invocation time.
+     * More providers may be added later if new modules are added on the classpath.
+     *
+     * @return descriptions of available data stores.
+     *
+     * @since 0.8
+     */
+    public static Collection<DataStoreProvider> providers() {
+        return registry().providers();
+    }
+
+    /**
      * Returns the MIME type of the storage file format, or {@code null} if unknown or not
applicable.
      *
      * @param  storage  the input/output object as a URL, file, image input stream, <i>etc.</i>.
@@ -112,16 +123,4 @@ public final class DataStores extends St
     public static DataStore open(final Object storage) throws UnsupportedStorageException,
DataStoreException {
         return registry().open(storage);
     }
-
-    /**
-     * Returns the set of data formats available at this method invocation time.
-     * More data may be added later if new modules are added on the classpath.
-     *
-     * @return descriptions of available data formats.
-     *
-     * @since 0.8
-     */
-    public static Collection<Format> formats() {
-        return registry().formats();
-    }
 }

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=1778495&r1=1778494&r2=1778495&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] Fri Jan 13 05:52:02 2017
@@ -21,6 +21,8 @@ import javax.xml.bind.JAXBException;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.internal.storage.Capability;
+import org.apache.sis.internal.storage.Capabilities;
 import org.apache.sis.internal.storage.xml.stream.StaxDataStoreProvider;
 
 
@@ -34,6 +36,7 @@ import org.apache.sis.internal.storage.x
  * @version 0.8
  * @module
  */
+@Capabilities({Capability.READ, Capability.WRITE})
 public final class StoreProvider extends StaxDataStoreProvider {
     /**
      * Creates a new GPX store provider.



Mime
View raw message