sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1775004 [3/3] - in /sis/trunk: ./ core/sis-build-helper/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/main/java/org/apache/sis/feature/builder/ core/sis-feature/src/main/java/org/apache/sis/internal/feature/ ...
Date Mon, 19 Dec 2016 08:23:45 GMT
Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] Mon Dec 19 08:23:44 2016
@@ -20,11 +20,10 @@ import java.io.IOException;
 import org.opengis.metadata.Metadata;
 import org.apache.sis.util.Debug;
 import org.apache.sis.util.Classes;
-import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
-import org.apache.sis.storage.DataStoreContentException;
+import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.metadata.ModifiableMetadata;
@@ -65,14 +64,14 @@ public class NetcdfStore extends DataSto
      * @throws DataStoreException if an error occurred while opening the NetCDF file.
      */
     public NetcdfStore(final StorageConnector connector) throws DataStoreException {
-        ArgumentChecks.ensureNonNull("connector", connector);
+        super(connector);
         try {
             decoder = NetcdfStoreProvider.decoder(listeners, connector);
         } catch (IOException e) {
             throw new DataStoreException(e);
         }
         if (decoder == null) {
-            throw new DataStoreContentException(Errors.format(Errors.Keys.IllegalInputTypeForReader_2,
+            throw new UnsupportedStorageException(errors().getString(Errors.Keys.IllegalInputTypeForReader_2,
                     "NetCDF", Classes.getClass(connector.getStorage())));
         }
     }
@@ -134,6 +133,14 @@ public class NetcdfStore extends DataSto
     }
 
     /**
+     * Returns the error resources in the current locale.
+     */
+    private Errors errors() {
+        // Must use "super" because NetcdfStore construction may not be finished.
+        return Errors.getResources(super.getLocale());
+    }
+
+    /**
      * Returns a string representation of this NetCDF store for debugging purpose.
      * The content of the string returned by this method may change in any future SIS version.
      *

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/IOUtilities.java
[UTF-8] Mon Dec 19 08:23:44 2016
@@ -31,16 +31,6 @@ import java.net.URL;
 import java.net.URLDecoder;
 import java.net.URISyntaxException;
 import java.net.MalformedURLException;
-import java.nio.channels.Channels;
-import java.nio.channels.ReadableByteChannel;
-import org.apache.sis.util.logging.Logging;
-import org.apache.sis.util.CharSequences;
-import org.apache.sis.util.Exceptions;
-import org.apache.sis.util.Static;
-import org.apache.sis.util.resources.Errors;
-import org.apache.sis.internal.system.Modules;
-
-// Branch-dependent imports
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.nio.file.Files;
@@ -48,7 +38,15 @@ import java.nio.file.InvalidPathExceptio
 import java.nio.file.FileSystemNotFoundException;
 import java.nio.file.OpenOption;
 import java.nio.file.StandardOpenOption;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
 import java.nio.charset.StandardCharsets;
+import org.apache.sis.util.logging.Logging;
+import org.apache.sis.util.CharSequences;
+import org.apache.sis.util.Exceptions;
+import org.apache.sis.util.Static;
+import org.apache.sis.util.resources.Errors;
+import org.apache.sis.internal.system.Modules;
 
 
 /**
@@ -85,8 +83,8 @@ public final class IOUtilities extends S
      * dedicated API like {@link Path#getFileName()}. Otherwise this method gets a string
representation of the path
      * and returns the part after the last {@code '/'} or platform-dependent name separator
character, if any.
      *
-     * @param  path The path as an instance of one of the above-cited types, or {@code null}.
-     * @return The filename in the given path, or {@code null} if the given object is null
or of unknown type.
+     * @param  path  the path as an instance of one of the above-cited types, or {@code null}.
+     * @return the filename in the given path, or {@code null} if the given object is null
or of unknown type.
      */
     public static String filename(final Object path) {
         return part(path, false);
@@ -97,8 +95,8 @@ public final class IOUtilities extends S
      * {@link CharSequence} instance. If no extension is found, returns an empty string.
If the given
      * object is of unknown type, return {@code null}.
      *
-     * @param  path The path as an instance of one of the above-cited types, or {@code null}.
-     * @return The extension in the given path, or an empty string if none, or {@code null}
+     * @param  path  the path as an instance of one of the above-cited types, or {@code null}.
+     * @return the extension in the given path, or an empty string if none, or {@code null}
      *         if the given object is null or of unknown type.
      */
     public static String extension(final Object path) {
@@ -147,8 +145,8 @@ public final class IOUtilities extends S
      * Returns a string representation of the given path, or {@code null} if none. The current
implementation
      * recognizes only the {@link Path}, {@link File}, {@link URL}, {@link URI} or {@link
CharSequence} types.
      *
-     * @param  path The path for which to return a string representation.
-     * @return The string representation, or {@code null} if none.
+     * @param  path  the path for which to return a string representation.
+     * @return the string representation, or {@code null} if none.
      */
     public static String toString(final Object path) {
         // For the following types, the string that we want can be obtained only by toString(),
@@ -175,8 +173,8 @@ public final class IOUtilities extends S
      * and the {@code %} character. Future versions may replace more characters as we learn
      * from experience.</p>
      *
-     * @param  path The path to encode, or {@code null}.
-     * @return The encoded path, or {@code null} if and only if the given path was null.
+     * @param  path  the path to encode, or {@code null}.
+     * @return the encoded path, or {@code null} if and only if the given path was null.
      */
     public static String encodeURI(final String path) {
         if (path == null) {
@@ -227,11 +225,11 @@ public final class IOUtilities extends S
      *   <li>Converts various exceptions into subclasses of {@link IOException}.</li>
      * </ul>
      *
-     * @param  url The URL to convert, or {@code null}.
-     * @param  encoding If the URL is encoded in a {@code application/x-www-form-urlencoded}
-     *         MIME format, the character encoding (normally {@code "UTF-8"}). If the URL
is
-     *         not encoded, then {@code null}.
-     * @return The URI for the given URL, or {@code null} if the given URL was null.
+     * @param  url       the URL to convert, or {@code null}.
+     * @param  encoding  if the URL is encoded in a {@code application/x-www-form-urlencoded}
MIME format,
+     *                   the character encoding (normally {@code "UTF-8"}). If the URL is
not encoded,
+     *                   then {@code null}.
+     * @return the URI for the given URL, or {@code null} if the given URL was null.
      * @throws IOException if the URL can not be converted to a URI.
      *
      * @see URI#URI(String)
@@ -276,11 +274,11 @@ public final class IOUtilities extends S
      *   <li>Converts various exceptions into subclasses of {@link IOException}.</li>
      * </ul>
      *
-     * @param  url The URL to convert, or {@code null}.
-     * @param  encoding If the URL is encoded in a {@code application/x-www-form-urlencoded}
-     *         MIME format, the character encoding (normally {@code "UTF-8"}). If the URL
is
-     *         not encoded, then {@code null}.
-     * @return The file for the given URL, or {@code null} if the given URL was null.
+     * @param  url       the URL to convert, or {@code null}.
+     * @param  encoding  if the URL is encoded in a {@code application/x-www-form-urlencoded}
MIME format,
+     *                   the character encoding (normally {@code "UTF-8"}). If the URL is
not encoded,
+     *                   then {@code null}.
+     * @return the file for the given URL, or {@code null} if the given URL was null.
      * @throws IOException if the URL can not be converted to a file.
      *
      * @see File#File(URI)
@@ -318,11 +316,11 @@ public final class IOUtilities extends S
      *   <li>Converts various exceptions into subclasses of {@link IOException}.</li>
      * </ul>
      *
-     * @param  url The URL to convert, or {@code null}.
-     * @param  encoding If the URL is encoded in a {@code application/x-www-form-urlencoded}
-     *         MIME format, the character encoding (normally {@code "UTF-8"}). If the URL
is
-     *         not encoded, then {@code null}.
-     * @return The path for the given URL, or {@code null} if the given URL was null.
+     * @param  url       the URL to convert, or {@code null}.
+     * @param  encoding  if the URL is encoded in a {@code application/x-www-form-urlencoded}
MIME format,
+     *                   the character encoding (normally {@code "UTF-8"}). If the URL is
not encoded,
+     *                   then {@code null}.
+     * @return the path for the given URL, or {@code null} if the given URL was null.
      * @throws IOException if the URL can not be converted to a path.
      *
      * @see Paths#get(URI)
@@ -363,13 +361,13 @@ public final class IOUtilities extends S
      * A URL can represent a file, but {@link URL#openStream()} appears to return a {@code
BufferedInputStream}
      * wrapping the {@link FileInputStream}, which is not a desirable feature when we want
to obtain a channel.
      *
-     * @param  path The path to convert, or {@code null}.
-     * @param  encoding If the URL is encoded in a {@code application/x-www-form-urlencoded}
-     *         MIME format, the character encoding (normally {@code "UTF-8"}). If the URL
is
-     *         not encoded, then {@code null}. This argument is ignored if the given path
does
-     *         not need to be converted from URL to {@code File}.
-     * @return The path as a {@link File} if possible, or a {@link URL} otherwise.
-     * @throws IOException If the given path is not a file and can't be parsed as a URL.
+     * @param  path      the path to convert, or {@code null}.
+     * @param  encoding  if the URL is encoded in a {@code application/x-www-form-urlencoded}
MIME format,
+     *                   the character encoding (normally {@code "UTF-8"}). If the URL is
not encoded,
+     *                   then {@code null}. This argument is ignored if the given path does
not need
+     *                   to be converted from URL to {@code File}.
+     * @return the path as a {@link File} if possible, or a {@link URL} otherwise.
+     * @throws IOException if the given path is not a file and can't be parsed as a URL.
      */
     public static Object toFileOrURL(final String path, final String encoding) throws IOException
{
         if (path == null) {
@@ -428,13 +426,13 @@ public final class IOUtilities extends S
      * would alter significatively the channel behavior depending on whether we have been
able to
      * honor the options or not.</p>
      *
-     * @param  input The file to open, or {@code null}.
-     * @param  encoding If the input is an encoded URL, the character encoding (normally
{@code "UTF-8"}).
-     *         If the URL is not encoded, then {@code null}. This argument is ignored if
the given input
-     *         does not need to be converted from URL to {@code File}.
-     * @param  options The options to use for creating a new byte channel. Can be null or
empty for read-only.
-     * @return The channel for the given input, or {@code null} if the given input is of
unknown type.
-     * @throws IOException If an error occurred while opening the given file.
+     * @param  input     the file to open, or {@code null}.
+     * @param  encoding  if the input is an encoded URL, the character encoding (normally
{@code "UTF-8"}).
+     *                   If the URL is not encoded, then {@code null}. This argument is ignored
if the given
+     *                   input does not need to be converted from URL to {@code File}.
+     * @param  options   the options to use for creating a new byte channel. Can be null
or empty for read-only.
+     * @return the channel for the given input, or {@code null} if the given input is of
unknown type.
+     * @throws IOException if an error occurred while opening the given file.
      */
     public static ReadableByteChannel open(Object input, final String encoding, OpenOption...
options) throws IOException {
         /*

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
[UTF-8] Mon Dec 19 08:23:44 2016
@@ -178,6 +178,7 @@ public final class Store extends DataSto
      * @throws DataStoreException if an error occurred while opening the stream.
      */
     public Store(final StorageConnector connector) throws DataStoreException {
+        super(connector);
         filename = connector.getStorageName();
         final Reader r = connector.getStorageAs(Reader.class);
         connector.closeAllExcept(r);

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
[UTF-8] Mon Dec 19 08:23:44 2016
@@ -85,6 +85,7 @@ final class Store extends DataStore {
      * @throws DataStoreException if an error occurred while opening the stream.
      */
     public Store(final StorageConnector connector) throws DataStoreException {
+        super(connector);
         objects = new ArrayList<>();
         name    = connector.getStorageName();
         source  = connector.getStorageAs(Reader.class);

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/Store.java
[UTF-8] Mon Dec 19 08:23:44 2016
@@ -84,6 +84,7 @@ final class Store extends DataStore {
      * @throws DataStoreException if an error occurred while opening the stream.
      */
     public Store(final StorageConnector connector) throws DataStoreException {
+        super(connector);
         name = connector.getStorageName();
         final InputStream in = connector.getStorageAs(InputStream.class);
         if (in != null) {

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8]
(original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8]
Mon Dec 19 08:23:44 2016
@@ -35,7 +35,7 @@ import org.apache.sis.util.logging.Warni
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  *
  * @see DataStores#open(Object)
@@ -43,6 +43,7 @@ import org.apache.sis.util.logging.Warni
 public abstract class DataStore implements Localized, AutoCloseable {
     /**
      * The locale to use for formatting warnings.
+     * This is not the locale for formatting data in the storage.
      *
      * @see #getLocale()
      * @see #setLocale(Locale)
@@ -63,6 +64,25 @@ public abstract class DataStore implemen
     }
 
     /**
+     * Creates a new instance for the given storage (typically file or database).
+     *
+     * @param connector information about the storage (URL, stream, reader instance, <i>etc</i>).
+     *
+     * @since 0.8
+     */
+    protected DataStore(final StorageConnector connector) {
+        ArgumentChecks.ensureNonNull("connector", connector);
+        locale = Locale.getDefault(Locale.Category.DISPLAY);
+        listeners = new WarningListeners<>(this);
+        /*
+         * A future version could fetch some information from the StorageConnector.
+         * For now we do not, not even OptionKey.LOCALE because we are not talking
+         * about the same locale (the one in this DataStore is for warning messages,
+         * not for data).
+         */
+    }
+
+    /**
      * The locale to use for formatting warnings and other messages. This locale if for user
interfaces
      * only - it has no effect on the data to be read or written from/to the data store.
      *

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/StorageConnector.java
[UTF-8] Mon Dec 19 08:23:44 2016
@@ -170,7 +170,7 @@ public class StorageConnector implements
      * Creates a new data store connection wrapping the given input/output object.
      * The object can be of any type, but the class javadoc lists the most typical ones.
      *
-     * @param storage The input/output object as a URL, file, image input stream, <i>etc.</i>.
+     * @param storage  the input/output object as a URL, file, image input stream, <i>etc.</i>.
      */
     public StorageConnector(final Object storage) {
         ArgumentChecks.ensureNonNull("storage", storage);
@@ -180,9 +180,9 @@ public class StorageConnector implements
     /**
      * Returns the option value for the given key, or {@code null} if none.
      *
-     * @param  <T> The type of option value.
-     * @param  key The option for which to get the value.
-     * @return The current value for the given option, or {@code null} if none.
+     * @param  <T>  the type of option value.
+     * @param  key  the option for which to get the value.
+     * @return the current value for the given option, or {@code null} if none.
      */
     public <T> T getOption(final OptionKey<T> key) {
         ArgumentChecks.ensureNonNull("key", key);
@@ -199,9 +199,9 @@ public class StorageConnector implements
      *   <li>{@link OptionKey#BYTE_BUFFER}  for allowing users to control the byte
buffer to be created.</li>
      * </ul>
      *
-     * @param <T>   The type of option value.
-     * @param key   The option for which to set the value.
-     * @param value The new value for the given option, or {@code null} for removing the
value.
+     * @param <T>    the type of option value.
+     * @param key    the option for which to set the value.
+     * @param value  the new value for the given option, or {@code null} for removing the
value.
      */
     public <T> void setOption(final OptionKey<T> key, final T value) {
         ArgumentChecks.ensureNonNull("key", key);
@@ -212,7 +212,7 @@ public class StorageConnector implements
      * Returns the input/output object given at construction time.
      * The object can be of any type, but the class javadoc lists the most typical ones.
      *
-     * @return The input/output object as a URL, file, image input stream, <i>etc.</i>.
+     * @return the input/output object as a URL, file, image input stream, <i>etc.</i>.
      *
      * @see #getStorageAs(Class)
      */
@@ -233,7 +233,7 @@ public class StorageConnector implements
      *       Note that the string representation of unknown types may change in any future
SIS version.</li>
      * </ul>
      *
-     * @return A short name of the storage object.
+     * @return a short name of the storage object.
      */
     public String getStorageName() {
         if (name == null) {
@@ -257,8 +257,8 @@ public class StorageConnector implements
      *   <li>For instances of unknown type, this method returns {@code null}.</li>
      * </ul>
      *
-     * @return The filename extension, or an empty string if none, or {@code null} if the
storage
-     *         is an object of unknown type.
+     * @return the filename extension, or an empty string if none,
+     *         or {@code null} if the storage is an object of unknown type.
      */
     public String getFileExtension() {
         if (extension == null) {
@@ -355,10 +355,10 @@ public class StorageConnector implements
      * database connection returned by this method. In addition, those {@code probeContent(StorageConnector)}
      * methods are responsible for restoring the stream or byte buffer to its original position
on return.
      *
-     * @param  <T>  The compile-time type of the {@code type} argument.
-     * @param  type The desired type as one of {@code ByteBuffer}, {@code DataInput}, {@code
Connection}
-     *         class or other type supported by {@code StorageConnector} subclasses.
-     * @return The storage as a view of the given type, or {@code null} if no view can be
created for the given type.
+     * @param  <T>   the compile-time type of the {@code type} argument.
+     * @param  type  the desired type as one of {@code ByteBuffer}, {@code DataInput}, {@code
Connection}
+     *               class or other type supported by {@code StorageConnector} subclasses.
+     * @return the storage as a view of the given type, or {@code null} if no view can be
created for the given type.
      * @throws IllegalArgumentException if the given {@code type} argument is not a supported
type.
      * @throws DataStoreException if an error occurred while opening a stream or database
connection.
      *
@@ -438,7 +438,7 @@ public class StorageConnector implements
      * Creates a view for the input as a {@link ChannelDataInput} if possible.
      * If the view can not be created, remember that fact in order to avoid new attempts.
      *
-     * @param  asImageInputStream If the {@code ChannelDataInput} needs to be {@link ChannelImageInputStream}
subclass.
+     * @param  asImageInputStream  whether the {@code ChannelDataInput} needs to be {@link
ChannelImageInputStream} subclass.
      * @throws IOException if an error occurred while opening a channel for the input.
      */
     private void createChannelDataInput(final boolean asImageInputStream) throws IOException
{
@@ -553,7 +553,7 @@ public class StorageConnector implements
                 if (n >= 1) {
                     asByteBuffer = ByteBuffer.wrap(buffer).order(in.getByteOrder());
                     asByteBuffer.limit(n);
-                    // Can't invoke asReadOnly() because 'prefetch()' need to be able to
write in it.
+                    // Can not invoke asReadOnly() because 'prefetch()' need to be able to
write in it.
                 }
             }
         }
@@ -602,10 +602,11 @@ public class StorageConnector implements
 
     /**
      * Creates a storage view of the given type if possible, or returns {@code null} otherwise.
-     * This method is invoked by {@link #getStorageAs(Class)} when first needed, and the
result is cached.
+     * This method is invoked by {@link #getStorageAs(Class)} when first needed, and the
result
+     * is cached by the caller.
      *
-     * @param  type The type of the view to create.
-     * @return The storage as a view of the given type, or {@code null} if no view can be
created for the given type.
+     * @param  type  the type of the view to create.
+     * @return the storage as a view of the given type, or {@code null} if no view can be
created for the given type.
      * @throws IllegalArgumentException if the given {@code type} argument is not a supported
type.
      * @throws Exception if an error occurred while opening a stream or database connection.
      */
@@ -680,9 +681,9 @@ public class StorageConnector implements
     /**
      * Adds the given view in the cache.
      *
-     * @param <T>   The compile-time type of the {@code type} argument.
-     * @param type  The view type.
-     * @param view  The view, or {@code null} if none.
+     * @param  <T>   the compile-time type of the {@code type} argument.
+     * @param  type  the view type.
+     * @param  view  the view, or {@code null} if none.
      */
     private <T> void addView(final Class<T> type, final T view) {
         if (views.put(type, (view != null) ? view : Void.TYPE) != null) {
@@ -693,9 +694,9 @@ public class StorageConnector implements
     /**
      * Returns the view for the given type from the cache.
      *
-     * @param <T>   The compile-time type of the {@code type} argument.
-     * @param type  The view type.
-     * @return      The view, or {@code null} if none.
+     * @param  <T>   the compile-time type of the {@code type} argument.
+     * @param  type  the view type.
+     * @return the view, or {@code null} if none.
      */
     private <T> T getView(final Class<T> type) {
         final Object view = views.get(type);
@@ -707,8 +708,8 @@ public class StorageConnector implements
      * The {@code input} argument is always a new instance wrapping, directly or indirectly,
the {@link #storage}.
      * Callers must specify the wrapped object in the {@code delegate} argument.
      *
-     * @param input    The newly created object which will need to be closed.
-     * @param delegate The object wrapped by the given {@code input}.
+     * @param  input     the newly created object which will need to be closed.
+     * @param  delegate  the object wrapped by the given {@code input}.
      */
     private void addViewToClose(final Object input, final Object delegate) {
         if (viewsToClose == null) {
@@ -731,7 +732,7 @@ public class StorageConnector implements
      *
      * <p>This {@code StorageConnector} instance shall not be used anymore after invocation
of this method.</p>
      *
-     * @param  view The view to leave open, or {@code null} if none.
+     * @param  view  the view to leave open, or {@code null} if none.
      * @throws DataStoreException if an error occurred while closing the stream or database
connection.
      *
      * @see #getStorageAs(Class)

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java?rev=1775004&r1=1775003&r2=1775004&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java
[UTF-8] Mon Dec 19 08:23:44 2016
@@ -19,6 +19,8 @@ package org.apache.sis.storage;
 
 /**
  * Thrown when no {@link DataStoreProvider} is found for a given storage object.
+ * May also be thrown if a {@code DataStore} is instantiated directly (without {@code DataStoreProvider}
+ * for verifying the input) but the data store can not handle the given input or output object.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4



Mime
View raw message