sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1755610 [7/7] - in /sis/branches/JDK7: ./ core/ 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/test/java/org/apache/sis/feature/ core/sis-feature/s...
Date Tue, 09 Aug 2016 14:48:05 GMT
Modified: sis/branches/JDK7/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/pom.xml (original)
+++ sis/branches/JDK7/pom.xml Tue Aug  9 14:48:04 2016
@@ -214,7 +214,7 @@ Apache SIS is a free software, Java lang
       <id>rmarechal</id>
       <email>remi.marechal@geomatys.com</email>
       <organization>Geomatys</organization>
-      <organizationUrl>http://www.geomatys.com/</organizationUrl>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
       <timezone>+1</timezone>
       <roles>
         <role>developer</role>
@@ -288,7 +288,7 @@ Apache SIS is a free software, Java lang
       <name>Johann Sorel</name>
       <email>johann.sorel@geomatys.com</email>
       <organization>Geomatys</organization>
-      <organizationUrl>http://www.geomatys.com/</organizationUrl>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
       <timezone>+1</timezone>
       <roles>
         <role>developer</role>

Modified: sis/branches/JDK7/storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/pom.xml?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/pom.xml (original)
+++ sis/branches/JDK7/storage/pom.xml Tue Aug  9 14:48:04 2016
@@ -65,12 +65,32 @@
       <name>Johann Sorel</name>
       <email>johann.sorel@geomatys.com</email>
       <organization>Geomatys</organization>
-      <organizationUrl>http://www.geomatys.com/</organizationUrl>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
       <timezone>+1</timezone>
       <roles>
         <role>developer</role>
       </roles>
     </contributor>
+    <contributor>
+      <name>Thi Phuong Hao Nguyen</name>
+      <email>nguyenthiphuonghao243@gmail.com</email>
+      <organization>VNSC</organization>
+      <organizationUrl>http://vnsc.org.vn</organizationUrl>
+      <timezone>+7</timezone>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </contributor>
+    <contributor>
+      <name>Minh Chinh Vu</name>
+      <email>chinhvm.uet.1995@gmail.com</email>
+      <organization>VNSC</organization>
+      <organizationUrl>http://vnsc.org.vn</organizationUrl>
+      <timezone>+7</timezone>
+      <roles>
+        <role>developer</role>
+      </roles>
+    </contributor>
   </contributors>
 
 
@@ -138,6 +158,7 @@
     <module>sis-storage</module>
     <module>sis-shapefile</module>
     <module>sis-netcdf</module>
+    <module>sis-geotiff</module>
   </modules>
 
 </project>

Modified: sis/branches/JDK7/storage/sis-geotiff/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/pom.xml?rev=1755610&r1=1755594&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/pom.xml (original)
+++ sis/branches/JDK7/storage/sis-geotiff/pom.xml Tue Aug  9 14:48:04 2016
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>storage</artifactId>
-    <version>0.8-jdk8-SNAPSHOT</version>
+    <version>0.8-jdk7-SNAPSHOT</version>
   </parent>
 
 

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java?rev=1755610&r1=1755594&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Reader.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -29,6 +29,10 @@ import org.apache.sis.internal.storage.C
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.util.resources.Errors;
 
+// Branch-dependent imports
+import java.util.Collections;
+import org.apache.sis.internal.jdk8.JDK8;
+
 
 /**
  * An image reader for GeoTIFF files. This reader duplicates the implementations performed by other libraries, but we
@@ -224,14 +228,14 @@ final class Reader extends GeoTIFF {
                 return null;
             }
             resolveDeferredEntries(null, nextIFD);
-            input.seek(Math.addExact(origin, nextIFD));
+            input.seek(JDK8.addExact(origin, nextIFD));
             nextIFD = 0;               // Prevent trying other IFD if we fail to read this one.
             /*
              * Design note: we parse the Image File Directory entry now because even if we were
              * not interrested in that IFD, we need to go anyway after its last record in order
              * to get the pointer to the next IFD.
              */
-            final int offsetSize = Integer.BYTES << intSizeExpansion;
+            final int offsetSize = (Integer.SIZE / Byte.SIZE) << intSizeExpansion;
             final ImageFileDirectory dir = new ImageFileDirectory();
             for (long remaining = readUnsignedShort(); --remaining >= 0;) {
                 /*
@@ -244,7 +248,7 @@ final class Reader extends GeoTIFF {
                 final int  tag   = input.readUnsignedShort();
                 final Type type  = Type.valueOf(input.readShort());        // May be null.
                 final long count = readUnsignedInt();
-                final long size  = (type != null) ? Math.multiplyExact(type.size, count) : 0;
+                final long size  = (type != null) ? JDK8.multiplyExact(type.size, count) : 0;
                 if (size <= offsetSize) {
                     /*
                      * If the value can fit inside the number of bytes given by 'offsetSize', then the value is
@@ -306,7 +310,7 @@ final class Reader extends GeoTIFF {
      */
     private void resolveDeferredEntries(final ImageFileDirectory dir, final long ignoreAfter) throws IOException {
         if (deferredNeedsSort) {
-            deferredEntries.sort(null);                                 // Sequential order in input stream.
+            Collections.sort(deferredEntries);                          // Sequential order in input stream.
             deferredNeedsSort = false;
         }
         final long ignoreBefore = input.getStreamPosition() - origin;   // Avoid seeking back, unless we need to.
@@ -320,7 +324,7 @@ final class Reader extends GeoTIFF {
         for (final Iterator<DeferredEntry> it = deferredEntries.iterator(); it.hasNext();) {
             final DeferredEntry entry = it.next();
             if (entry.owner == dir || (entry.offset >= ignoreBefore && entry.offset <= ignoreAfter)) {
-                input.seek(Math.addExact(origin, entry.offset));
+                input.seek(JDK8.addExact(origin, entry.offset));
                 Object error;
                 try {
                     error = entry.owner.addEntry(this, entry.tag, entry.type, entry.count);

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java?rev=1755610&r1=1755594&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/Type.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -26,6 +26,9 @@ import org.apache.sis.math.Vector;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.resources.Errors;
 
+// Branch-dependent imports
+import org.apache.sis.internal.jdk8.JDK8;
+
 
 /**
  * The types of values in a TIFF header. Provides also some support for reading a value of a given type.
@@ -47,7 +50,7 @@ enum Type {
      *   <li>TIFF code: 7</li>
      * </ul>
      */
-    UNDEFINED(7, Byte.BYTES, false),
+    UNDEFINED(7, Byte.SIZE / Byte.SIZE, false),
 
     /**
      * An 8-bits signed (twos-complement) integer.
@@ -56,7 +59,7 @@ enum Type {
      *   <li>TIFF code: 6</li>
      * </ul>
      */
-    BYTE(6, Byte.BYTES, false) {
+    BYTE(6, Byte.SIZE / Byte.SIZE, false) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             return input.readByte();
@@ -74,7 +77,7 @@ enum Type {
      *   <li>TIFF code: 1</li>
      * </ul>
      */
-    UBYTE(1, Byte.BYTES, true) {
+    UBYTE(1, Byte.SIZE / Byte.SIZE, true) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             return input.readUnsignedByte();
@@ -92,7 +95,7 @@ enum Type {
      *   <li>TIFF code: 8</li>
      * </ul>
      */
-    SHORT(8, Short.BYTES, false) {
+    SHORT(8, Short.SIZE / Byte.SIZE, false) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             return input.readShort();
@@ -110,7 +113,7 @@ enum Type {
      *   <li>TIFF code: 3</li>
      * </ul>
      */
-    USHORT(3, Short.BYTES, true) {
+    USHORT(3, Short.SIZE / Byte.SIZE, true) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             return input.readUnsignedShort();
@@ -128,7 +131,7 @@ enum Type {
      *   <li>TIFF code: 9</li>
      * </ul>
      */
-    INT(9, Integer.BYTES, false) {
+    INT(9, Integer.SIZE / Byte.SIZE, false) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             return input.readInt();
@@ -146,7 +149,7 @@ enum Type {
      *   <li>TIFF code: 4</li>
      * </ul>
      */
-    UINT(4, Integer.BYTES, true) {
+    UINT(4, Integer.SIZE / Byte.SIZE, true) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             return input.readUnsignedInt();
@@ -163,7 +166,7 @@ enum Type {
      *   <li>TIFF code: 17</li>
      * </ul>
      */
-    LONG(17, Long.BYTES, false) {
+    LONG(17, Long.SIZE / Byte.SIZE, false) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             return input.readLong();
@@ -180,14 +183,14 @@ enum Type {
      *   <li>TIFF code: 16</li>
      * </ul>
      */
-    ULONG(16, Long.BYTES, true) {
+    ULONG(16, Long.SIZE / Byte.SIZE, true) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             final long value = input.readLong();
             if (value >= 0) {
                 return value;
             }
-            throw new ArithmeticException(canNotConvert(Long.toUnsignedString(value)));
+            throw new ArithmeticException(canNotConvert(JDK8.toUnsignedString(value)));
         }
 
         @Override double readDouble(final ChannelDataInput input, final long count) throws IOException {
@@ -207,7 +210,7 @@ enum Type {
      *   <li>TIFF code: 11</li>
      * </ul>
      */
-    FLOAT(11, Float.BYTES, false) {
+    FLOAT(11, Float.SIZE / Byte.SIZE, false) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             final float value = input.readFloat();
@@ -235,7 +238,7 @@ enum Type {
      *   <li>TIFF code: 12</li>
      * </ul>
      */
-    DOUBLE(12, Double.BYTES, false) {
+    DOUBLE(12, Double.SIZE / Byte.SIZE, false) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             final double value = input.readDouble();
@@ -263,7 +266,7 @@ enum Type {
      *   <li>TIFF code: 10</li>
      * </ul>
      */
-    RATIONAL(10, (2*Integer.BYTES), false) {
+    RATIONAL(10, (2*Integer.SIZE / Byte.SIZE), false) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             final int numerator   = input.readInt();
@@ -294,7 +297,7 @@ enum Type {
      *   <li>TIFF code: 5</li>
      * </ul>
      */
-    URATIONAL(5, (2*Integer.BYTES), true) {
+    URATIONAL(5, (2*Integer.SIZE / Byte.SIZE), true) {
         @Override long readLong(final ChannelDataInput input, final long count) throws IOException {
             ensureSingleton(count);
             final long numerator   = input.readUnsignedInt();
@@ -327,9 +330,9 @@ enum Type {
      *   <li>TIFF code: 2</li>
      * </ul>
      */
-    ASCII(2, Byte.BYTES, false) {
+    ASCII(2, Byte.SIZE / Byte.SIZE, false) {
         @Override String[] readString(final ChannelDataInput input, final long length, final Charset charset) throws IOException {
-            final byte[] chars = input.readBytes(Math.toIntExact(length));
+            final byte[] chars = input.readBytes(JDK8.toIntExact(length));
             String[] lines = new String[1];                     // We will usually have exactly one string.
             int count = 0, lower = 0;
             for (int i=0; i<chars.length; i++) {
@@ -450,7 +453,7 @@ enum Type {
         if (value >= 0) {
             return value;
         }
-        throw new ArithmeticException(canNotConvert(Long.toUnsignedString(value)));
+        throw new ArithmeticException(canNotConvert(JDK8.toUnsignedString(value)));
     }
 
     /**
@@ -506,7 +509,7 @@ enum Type {
      * @throws UnsupportedOperationException if this type is {@link #UNDEFINED}.
      */
     String[] readString(final ChannelDataInput input, final long length, final Charset charset) throws IOException {
-        final String[] s = new String[Math.toIntExact(length)];
+        final String[] s = new String[JDK8.toIntExact(length)];
         for (int i=0; i<s.length; i++) {
             s[i] = String.valueOf(readLong(input, 1));
         }
@@ -540,6 +543,6 @@ enum Type {
      * @throws UnsupportedOperationException if this type is {@link #UNDEFINED}.
      */
     final Vector readVector(final ChannelDataInput input, final long count) throws IOException {
-        return Vector.create(readArray(input, Math.toIntExact(count)), isUnsigned);
+        return Vector.create(readArray(input, JDK8.toIntExact(count)), isUnsigned);
     }
 }

Modified: sis/branches/JDK7/storage/sis-netcdf/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/pom.xml?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/pom.xml (original)
+++ sis/branches/JDK7/storage/sis-netcdf/pom.xml Tue Aug  9 14:48:04 2016
@@ -66,7 +66,7 @@ Bridge between NetCDF Climate and Foreca
     <contributor>
       <name>Antoine Hnawia</name>
       <organization>Institut de Recherche pour le Développement</organization>
-      <organizationUrl>http://www.ird.fr/</organizationUrl>
+      <organizationUrl>http://www.ird.fr</organizationUrl>
       <timezone>+11</timezone>
       <roles>
         <role>developer</role>
@@ -76,7 +76,7 @@ Bridge between NetCDF Climate and Foreca
       <name>Johann Sorel</name>
       <email>johann.sorel@geomatys.com</email>
       <organization>Geomatys</organization>
-      <organizationUrl>http://www.geomatys.com/</organizationUrl>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
       <timezone>+1</timezone>
       <roles>
         <role>developer</role>

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/ChannelDecoder.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -39,6 +39,7 @@ import org.apache.sis.internal.netcdf.Gr
 import org.apache.sis.internal.storage.ChannelDataInput;
 import org.apache.sis.internal.util.CollectionsExt;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.util.iso.DefaultNameSpace;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.resources.Vocabulary;
@@ -60,7 +61,7 @@ import org.apache.sis.internal.jdk8.Func
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.3
+ * @version 0.8
  * @module
  *
  * @see <a href="http://portal.opengeospatial.org/files/?artifact_id=43734">NetCDF Classic and 64-bit Offset Format (1.0)</a>
@@ -202,7 +203,7 @@ public final class ChannelDecoder extend
          */
         int version = input.readInt();
         if ((version & 0xFFFFFF00) != MAGIC_NUMBER) {
-            throw new DataStoreException(errors().getString(Errors.Keys.UnexpectedFileFormat_2, "NetCDF", input.filename));
+            throw new DataStoreContentException(errors().getString(Errors.Keys.UnexpectedFileFormat_2, "NetCDF", input.filename));
         }
         /*
          * Check the version number.
@@ -211,7 +212,7 @@ public final class ChannelDecoder extend
         switch (version) {
             case 1:  is64bits = false; break;
             case 2:  is64bits = true;  break;
-            default: throw new DataStoreException(errors().getString(Errors.Keys.UnsupportedVersion_1, version));
+            default: throw new DataStoreContentException(errors().getString(Errors.Keys.UnsupportedVersion_1, version));
             // If more cases are added, remember to increment the MAX_VERSION constant.
         }
         numrecs = input.readInt();
@@ -272,7 +273,7 @@ public final class ChannelDecoder extend
      * that the file should be a NetCDF one, but we found some inconsistency or unknown tags.
      */
     private DataStoreException malformedHeader() {
-        return new DataStoreException(errors().getString(Errors.Keys.CanNotParseFile_2, "NetCDF", input.filename));
+        return new DataStoreContentException(errors().getString(Errors.Keys.CanNotParseFile_2, "NetCDF", input.filename));
     }
 
     /**
@@ -280,7 +281,7 @@ public final class ChannelDecoder extend
      */
     private void ensureNonNegative(final int nelems, final int tag) throws DataStoreException {
         if (nelems < 0) {
-            throw new DataStoreException(errors().getString(Errors.Keys.NegativeArrayLength_1,
+            throw new DataStoreContentException(errors().getString(Errors.Keys.NegativeArrayLength_1,
                     input.filename + DefaultNameSpace.DEFAULT_SEPARATOR + tagName(tag)));
         }
     }
@@ -305,7 +306,7 @@ public final class ChannelDecoder extend
         if (size > input.buffer.capacity()) {
             name = input.filename + DefaultNameSpace.DEFAULT_SEPARATOR + name;
             final Errors errors = errors();
-            throw new DataStoreException(n < 0 ?
+            throw new DataStoreContentException(n < 0 ?
                     errors.getString(Errors.Keys.NegativeArrayLength_1, name) :
                     errors.getString(Errors.Keys.ExcessiveListSize_2, name, n));
         }
@@ -416,7 +417,7 @@ public final class ChannelDecoder extend
             if (length == 0) {
                 length = numrecs;
                 if (length == STREAMING) {
-                    throw new DataStoreException(errors().getString(Errors.Keys.MissingValueForProperty_1, "numrecs"));
+                    throw new DataStoreContentException(errors().getString(Errors.Keys.MissingValueForProperty_1, "numrecs"));
                 }
             }
             dimensions[i] = new Dimension(name, length);
@@ -535,7 +536,7 @@ public final class ChannelDecoder extend
         try {
             return CollectionsExt.toCaseInsensitiveNameMap(Arrays.asList(elements), nameFunction, NAME_LOCALE);
         } catch (InvalidParameterCardinalityException e) {
-            throw new DataStoreException(errors().getString(Errors.Keys.ValueAlreadyDefined_1, e.getParameterName()));
+            throw new DataStoreContentException(errors().getString(Errors.Keys.ValueAlreadyDefined_1, e.getParameterName()));
         }
     }
 

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/impl/VariableInfo.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -26,6 +26,7 @@ import org.apache.sis.internal.storage.C
 import org.apache.sis.internal.storage.HyperRectangleReader;
 import org.apache.sis.internal.storage.Region;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.Numbers;
 
@@ -36,7 +37,7 @@ import org.apache.sis.util.Numbers;
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.7
+ * @version 0.8
  * @module
  */
 final class VariableInfo extends Variable {
@@ -309,14 +310,14 @@ final class VariableInfo extends Variabl
     @Override
     public Object read() throws IOException, DataStoreException {
         if (reader == null) {
-            throw new DataStoreException(unknownType());
+            throw new DataStoreContentException(unknownType());
         }
         long length = 1;
         for (final Dimension dimension : dimensions) {
             length *= dimension.length;
         }
         if (length > Integer.MAX_VALUE) {
-            throw new DataStoreException(Errors.format(Errors.Keys.ExcessiveListSize_2, name, length));
+            throw new DataStoreContentException(Errors.format(Errors.Keys.ExcessiveListSize_2, name, length));
         }
         final int dimension = dimensions.length;
         final long[] size  = new long[dimension];
@@ -339,7 +340,7 @@ final class VariableInfo extends Variabl
     @Override
     public Object read(int[] areaLower, int[] areaUpper, int[] subsampling) throws IOException, DataStoreException {
         if (reader == null) {
-            throw new DataStoreException(unknownType());
+            throw new DataStoreContentException(unknownType());
         }
         /*
          * NetCDF sorts datas in reverse dimension order. Example:

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/VariableWrapper.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -26,6 +26,7 @@ import ucar.nc2.Dimension;
 import ucar.nc2.VariableIF;
 import org.apache.sis.internal.netcdf.Variable;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.DataStoreContentException;
 
 
 /**
@@ -34,7 +35,7 @@ import org.apache.sis.storage.DataStoreE
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Johann Sorel (Geomatys)
  * @since   0.3
- * @version 0.7
+ * @version 0.8
  * @module
  */
 final class VariableWrapper extends Variable {
@@ -206,7 +207,7 @@ final class VariableWrapper extends Vari
         try {
             array = variable.read(new Section(areaLower, size, subsampling));
         } catch (InvalidRangeException e) {
-            throw new DataStoreException(e);
+            throw new DataStoreContentException(e);
         }
         return array.get1DJavaArray(array.getElementType());
     }

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -24,6 +24,7 @@ import org.apache.sis.util.ArgumentCheck
 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.StorageConnector;
 import org.apache.sis.internal.netcdf.Decoder;
 import org.apache.sis.metadata.ModifiableMetadata;
@@ -68,7 +69,7 @@ public class NetcdfStore extends DataSto
             throw new DataStoreException(e);
         }
         if (decoder == null) {
-            throw new DataStoreException(Errors.format(Errors.Keys.IllegalInputTypeForReader_2,
+            throw new DataStoreContentException(Errors.format(Errors.Keys.IllegalInputTypeForReader_2,
                     "NetCDF", Classes.getClass(storage.getStorage())));
         }
     }

Modified: sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStoreProvider.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -120,7 +120,7 @@ public class NetcdfStoreProvider extends
      * only that there appears to be a reasonable chance of success based on a brief inspection of the
      * {@linkplain StorageConnector#getStorage() storage object} or contents.
      *
-     * @param  storage Information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
+     * @param  storage  information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
      * @return {@code SUPPORTED} if the given storage seems to be usable by the {@code NetcdfStore} instances.
      * @throws DataStoreException if an I/O error occurred.
      */
@@ -174,7 +174,7 @@ public class NetcdfStoreProvider extends
                         Logging.recoverableException(Logging.getLogger(Modules.NETCDF), netcdfFileClass, "canOpen", cause);
                         return ProbeResult.UNSUPPORTED_STORAGE;
                     }
-                    throw new DataStoreException(e); // The cause may be IOException.
+                    throw new DataStoreException(e);                        // The cause may be IOException.
                 }
             } else {
                 /*
@@ -203,8 +203,8 @@ public class NetcdfStoreProvider extends
     /**
      * Returns a {@link NetcdfStore} implementation associated with this provider.
      *
-     * @param  storage Information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
-     * @return A data store implementation associated with this provider for the given storage.
+     * @param  storage information about the storage (URL, stream, {@link ucar.nc2.NetcdfFile} instance, <i>etc</i>).
+     * @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.
      */
     @Override
@@ -216,9 +216,9 @@ public class NetcdfStoreProvider extends
      * Creates a decoder for the given input. This method invokes
      * {@link StorageConnector#closeAllExcept(Object)} after the decoder has been created.
      *
-     * @param  listeners Where to send the warnings.
-     * @param  storage Information about the input (file, input stream, <i>etc.</i>)
-     * @return The decoder for the given input, or {@code null} if the input type is not recognized.
+     * @param  listeners  where to send the warnings.
+     * @param  storage    information about the input (file, input stream, <i>etc.</i>)
+     * @return the decoder for the given input, or {@code null} if the input type is not recognized.
      * @throws IOException if an error occurred while opening the NetCDF file.
      * @throws DataStoreException if a logical error (other than I/O) occurred.
      */
@@ -253,11 +253,11 @@ public class NetcdfStoreProvider extends
      * not create our embedded NetCDF decoder. This method uses reflection for creating the wrapper, in order
      * to keep the UCAR dependency optional.
      *
-     * @param  listeners Where to send the warnings.
-     * @param  input  The NetCDF file object of filename string from which to read data.
-     * @param  isUCAR {@code true} if {@code input} is an instance of the UCAR {@link ucar.nc2.NetcdfFile} object,
-     *                or {@code false} if it is the filename as a {@code String}.
-     * @return The {@link DecoderWrapper} instance for the given input, or {@code null} if the input type is not recognized.
+     * @param  listeners  where to send the warnings.
+     * @param  input      the NetCDF file object of filename string from which to read data.
+     * @param  isUCAR     {@code true} if {@code input} is an instance of the UCAR {@link ucar.nc2.NetcdfFile} object,
+     *                    or {@code false} if it is the filename as a {@code String}.
+     * @return the {@link DecoderWrapper} instance for the given input, or {@code null} if the input type is not recognized.
      * @throws IOException if an error occurred while opening the NetCDF file.
      * @throws DataStoreException if a logical error (other than I/O) occurred.
      */
@@ -327,7 +327,7 @@ public class NetcdfStoreProvider extends
                     parameterTypes[1] = String.class;
                     createFromPath = wrapper.getConstructor(parameterTypes);
                 } catch (ReflectiveOperationException e) {
-                    throw new AssertionError(e); // Should never happen (shall be verified by the JUnit tests).
+                    throw new AssertionError(e);        // Should never happen (shall be verified by the JUnit tests).
                 }
             }
         }

Modified: sis/branches/JDK7/storage/sis-storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/pom.xml?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/pom.xml (original)
+++ sis/branches/JDK7/storage/sis-storage/pom.xml Tue Aug  9 14:48:04 2016
@@ -79,7 +79,7 @@ Provides the interfaces and base classes
       <name>Johann Sorel</name>
       <email>johann.sorel@geomatys.com</email>
       <organization>Geomatys</organization>
-      <organizationUrl>http://www.geomatys.com/</organizationUrl>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
       <timezone>+1</timezone>
       <roles>
         <role>developer</role>
@@ -89,7 +89,7 @@ Provides the interfaces and base classes
       <name>Rémi Maréchal</name>
       <email>remi.marechal@geomatys.com</email>
       <organization>Geomatys</organization>
-      <organizationUrl>http://www.geomatys.com/</organizationUrl>
+      <organizationUrl>http://www.geomatys.com</organizationUrl>
       <timezone>+1</timezone>
       <roles>
         <role>developer</role>

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/ChannelDataInput.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -76,12 +76,12 @@ public class ChannelDataInput extends Ch
      * If the buffer already contains some data, then the {@code filled} argument shall be {@code true}.
      * Otherwise (e.g. if it is a newly created buffer), then {@code filled} shall be {@code false}.
      *
-     * @param  filename A file identifier used only for formatting error message.
-     * @param  channel  The channel from where data are read.
-     * @param  buffer   The buffer where to copy the data.
-     * @param  filled   {@code true} if the buffer already contains data, or {@code false} if it needs
-     *                  to be initially filled with some content read from the channel.
-     * @throws IOException If an error occurred while reading the channel.
+     * @param  filename  a file identifier used only for formatting error message.
+     * @param  channel   the channel from where data are read.
+     * @param  buffer    the buffer where to copy the data.
+     * @param  filled    {@code true} if the buffer already contains data, or {@code false} if it needs
+     *                   to be initially filled with some content read from the channel.
+     * @throws IOException if an error occurred while reading the channel.
      */
     public ChannelDataInput(final String filename, final ReadableByteChannel channel, final ByteBuffer buffer,
             final boolean filled) throws IOException
@@ -101,8 +101,8 @@ public class ChannelDataInput extends Ch
      * <cite>end of stream</cite>. Otherwise this method reads an arbitrary amount of bytes not greater
      * than the space available in the buffer, and returns the amount bytes actually read.
      *
-     * @return The number of bytes read, or -2 if the buffer is full, or -1 on <cite>end of stream</cite>.
-     * @throws IOException If an error occurred while reading the bytes.
+     * @return the number of bytes read, or -2 if the buffer is full, or -1 on <cite>end of stream</cite>.
+     * @throws IOException if an error occurred while reading the bytes.
      *
      * @since 0.4
      */
@@ -130,7 +130,7 @@ public class ChannelDataInput extends Ch
      * the channel has reached the end of stream, then this method returns {@code false}.
      *
      * @return {@code true} if the buffer contains at least one remaining byte.
-     * @throws IOException If it was necessary to read from the channel and this operation failed.
+     * @throws IOException if it was necessary to read from the channel and this operation failed.
      */
     public final boolean hasRemaining() throws IOException {
         if (buffer.hasRemaining()) {
@@ -152,9 +152,9 @@ public class ChannelDataInput extends Ch
      * It is caller's responsibility to ensure that the given number of bytes is
      * not greater than the {@linkplain ByteBuffer#capacity() buffer capacity}.
      *
-     * @param  n The minimal number of bytes needed in the {@linkplain #buffer buffer}.
-     * @throws EOFException If the channel has reached the end of stream.
-     * @throws IOException If an other kind of error occurred while reading.
+     * @param  n  the minimal number of bytes needed in the {@linkplain #buffer buffer}.
+     * @throws EOFException if the channel has reached the end of stream.
+     * @throws IOException if an other kind of error occurred while reading.
      */
     public final void ensureBufferContains(int n) throws EOFException, IOException {
         assert n >= 0 && n <= buffer.capacity() : n;
@@ -179,8 +179,8 @@ public class ChannelDataInput extends Ch
     /**
      * Makes sure that the buffer contains at least one remaining byte.
      *
-     * @throws EOFException If the channel has reached the end of stream.
-     * @throws IOException If an other kind of error occurred while reading.
+     * @throws EOFException if the channel has reached the end of stream.
+     * @throws IOException if an other kind of error occurred while reading.
      */
     private void ensureNonEmpty() throws IOException {
         if (!hasRemaining()) {
@@ -207,8 +207,8 @@ public class ChannelDataInput extends Ch
      * Reads a single bit from the stream. The bit to be read depends on the
      * {@linkplain #getBitOffset() current bit offset}.
      *
-     * @return The value of the next bit from the stream.
-     * @throws IOException If an error occurred while reading (including EOF).
+     * @return the value of the next bit from the stream.
+     * @throws IOException if an error occurred while reading (including EOF).
      */
     public final int readBit() throws IOException {
         return (int) readBits(1);
@@ -218,9 +218,9 @@ public class ChannelDataInput extends Ch
      * Reads many bits from the stream. The first bit to be read depends on the
      * {@linkplain #getBitOffset() current bit offset}.
      *
-     * @param  numBits The number of bits to read.
-     * @return The value of the next bits from the stream.
-     * @throws IOException If an error occurred while reading (including EOF).
+     * @param  numBits  the number of bits to read.
+     * @return the value of the next bits from the stream.
+     * @throws IOException if an error occurred while reading (including EOF).
      */
     public final long readBits(int numBits) throws IOException {
         ensureBetween("numBits", 0, Long.SIZE, numBits);
@@ -253,8 +253,8 @@ public class ChannelDataInput extends Ch
      * least 1 byte remaining in the buffer, reading new bytes from the channel if necessary,
      * then delegates to {@link ByteBuffer#get()}.
      *
-     * @return The value of the next byte from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next byte from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final byte readByte() throws IOException {
         ensureBufferContains(Byte.SIZE / Byte.SIZE);
@@ -269,8 +269,8 @@ public class ChannelDataInput extends Ch
      *     return Byte.toUnsignedInt(readByte());
      * }
      *
-     * @return The value of the next unsigned byte from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next unsigned byte from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final int readUnsignedByte() throws IOException {
         return readByte() & 0xFF;
@@ -281,8 +281,8 @@ public class ChannelDataInput extends Ch
      * least 2 bytes remaining in the buffer, reading new bytes from the channel if necessary,
      * then delegates to {@link ByteBuffer#getShort()}.
      *
-     * @return The value of the next short from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next short from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final short readShort() throws IOException {
         ensureBufferContains(Short.SIZE / Byte.SIZE);
@@ -297,8 +297,8 @@ public class ChannelDataInput extends Ch
      *     return Short.toUnsignedInt(readShort());
      * }
      *
-     * @return The value of the next unsigned short from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next unsigned short from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final int readUnsignedShort() throws IOException {
         return readShort() & 0xFFFF;
@@ -309,8 +309,8 @@ public class ChannelDataInput extends Ch
      * least 2 bytes remaining in the buffer, reading new bytes from the channel if necessary,
      * then delegates to {@link ByteBuffer#getChar()}.
      *
-     * @return The value of the next character from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next character from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final char readChar() throws IOException {
         ensureBufferContains(Character.SIZE / Byte.SIZE);
@@ -322,8 +322,8 @@ public class ChannelDataInput extends Ch
      * least 4 bytes remaining in the buffer, reading new bytes from the channel if necessary, then
      * delegates to {@link ByteBuffer#getInt()}.
      *
-     * @return The value of the next integer from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next integer from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final int readInt() throws IOException {
         ensureBufferContains(Integer.SIZE / Byte.SIZE);
@@ -338,8 +338,8 @@ public class ChannelDataInput extends Ch
      *     return Integer.toUnsignedLong(readInt());
      * }
      *
-     * @return The value of the next unsigned integer from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next unsigned integer from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final long readUnsignedInt() throws IOException {
         return readInt() & 0xFFFFFFFFL;
@@ -350,8 +350,8 @@ public class ChannelDataInput extends Ch
      * least 8 bytes remaining in the buffer, reading new bytes from the channel if necessary,
      * then delegates to {@link ByteBuffer#getLong()}.
      *
-     * @return The value of the next integer from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next integer from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final long readLong() throws IOException {
         ensureBufferContains(Long.SIZE / Byte.SIZE);
@@ -363,8 +363,8 @@ public class ChannelDataInput extends Ch
      * least 4 bytes remaining in the buffer, reading new bytes from the channel if necessary,
      * then delegates to {@link ByteBuffer#getFloat()}.
      *
-     * @return The value of the next float from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next float from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final float readFloat() throws IOException {
         ensureBufferContains(Float.SIZE / Byte.SIZE);
@@ -376,8 +376,8 @@ public class ChannelDataInput extends Ch
      * least 8 bytes remaining in the buffer, reading new bytes from the channel if necessary,
      * then delegates to {@link ByteBuffer#getDouble()}.
      *
-     * @return The value of the next double from the stream.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the value of the next double from the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final double readDouble() throws IOException {
         ensureBufferContains(Double.SIZE / Byte.SIZE);
@@ -389,8 +389,8 @@ public class ChannelDataInput extends Ch
      * This is a convenience method for {@link #readFully(byte[], int, int)} with a new array.
      *
      * @param  length The number of bytes to read.
-     * @return The next bytes in a newly allocated array of the given length.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the next bytes in a newly allocated array of the given length.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final byte[] readBytes(final int length) throws IOException {
         final byte[] array = new byte[length];
@@ -403,8 +403,8 @@ public class ChannelDataInput extends Ch
      * This is a convenience method for {@link #readFully(char[], int, int)} with a new array.
      *
      * @param  length The number of characters to read.
-     * @return The next characters in a newly allocated array of the given length.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the next characters in a newly allocated array of the given length.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final char[] readChars(final int length) throws IOException {
         final char[] array = new char[length];
@@ -417,8 +417,8 @@ public class ChannelDataInput extends Ch
      * This is a convenience method for {@link #readFully(short[], int, int)} with a new array.
      *
      * @param  length The number of shorts to read.
-     * @return The next shorts in a newly allocated array of the given length.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the next shorts in a newly allocated array of the given length.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final short[] readShorts(final int length) throws IOException {
         final short[] array = new short[length];
@@ -431,8 +431,8 @@ public class ChannelDataInput extends Ch
      * This is a convenience method for {@link #readFully(int[], int, int)} with a new array.
      *
      * @param  length The number of integers to read.
-     * @return The next integers in a newly allocated array of the given length.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the next integers in a newly allocated array of the given length.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final int[] readInts(final int length) throws IOException {
         final int[] array = new int[length];
@@ -445,8 +445,8 @@ public class ChannelDataInput extends Ch
      * This is a convenience method for {@link #readFully(long[], int, int)} with a new array.
      *
      * @param  length The number of longs to read.
-     * @return The next longs in a newly allocated array of the given length.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the next longs in a newly allocated array of the given length.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final long[] readLongs(final int length) throws IOException {
         final long[] array = new long[length];
@@ -459,8 +459,8 @@ public class ChannelDataInput extends Ch
      * This is a convenience method for {@link #readFully(float[], int, int)} with a new array.
      *
      * @param  length The number of floats to read.
-     * @return The next floats in a newly allocated array of the given length.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the next floats in a newly allocated array of the given length.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final float[] readFloats(final int length) throws IOException {
         final float[] array = new float[length];
@@ -473,8 +473,8 @@ public class ChannelDataInput extends Ch
      * This is a convenience method for {@link #readFully(double[], int, int)} with a new array.
      *
      * @param  length The number of doubles to read.
-     * @return The next doubles in a newly allocated array of the given length.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @return the next doubles in a newly allocated array of the given length.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final double[] readDoubles(final int length) throws IOException {
         final double[] array = new double[length];
@@ -491,7 +491,7 @@ public class ChannelDataInput extends Ch
      * }
      *
      * @param  dest An array of bytes to be written to.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final byte[] dest) throws IOException {
         readFully(dest, 0, dest.length);
@@ -501,10 +501,10 @@ public class ChannelDataInput extends Ch
      * Reads {@code length} bytes from the stream, and stores them into
      * {@code dest} starting at index {@code offset}.
      *
-     * @param  dest   An array of bytes to be written to.
-     * @param  offset The starting position within {@code dest} to write.
-     * @param  length The number of bytes to read.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @param  dest    an array of bytes to be written to.
+     * @param  offset  the starting position within {@code dest} to write.
+     * @param  length  the number of bytes to read.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final byte[] dest, int offset, int length) throws IOException {
         while (length != 0) {
@@ -567,9 +567,9 @@ public class ChannelDataInput extends Ch
          * the full content of {@link ChannelDataInput#buffer} (i.e. the view element at index 0 shall be
          * defined by the buffer elements starting at index 0).</p>
          *
-         * @param  view     Existing buffer to use as a view over {@link ChannelDataInput#buffer}, or {@code null}.
-         * @param  offset   The starting position within {@code dest} to write.
-         * @param  length   The number of values to read.
+         * @param  view     existing buffer to use as a view over {@link ChannelDataInput#buffer}, or {@code null}.
+         * @param  offset   the starting position within {@code dest} to write.
+         * @param  length   the number of values to read.
          * @throws IOException if an error (including EOF) occurred while reading the stream.
          */
         @Override
@@ -738,7 +738,7 @@ public class ChannelDataInput extends Ch
      * @param  dest   An array of characters to be written to.
      * @param  offset The starting position within {@code dest} to write.
      * @param  length The number of characters to read.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final char[] dest, final int offset, final int length) throws IOException {
         new CharsReader(dest).readFully(null, offset, length);
@@ -751,7 +751,7 @@ public class ChannelDataInput extends Ch
      * @param  dest   An array of short integers to be written to.
      * @param  offset The starting position within {@code dest} to write.
      * @param  length The number of short integers to read.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final short[] dest, final int offset, final int length) throws IOException {
         new ShortsReader(dest).readFully(null, offset, length);
@@ -761,10 +761,10 @@ public class ChannelDataInput extends Ch
      * Reads {@code length} integers from the stream, and stores them into
      * {@code dest} starting at index {@code offset}.
      *
-     * @param  dest   An array of integers to be written to.
-     * @param  offset The starting position within {@code dest} to write.
-     * @param  length The number of integers to read.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @param  dest    an array of integers to be written to.
+     * @param  offset  the starting position within {@code dest} to write.
+     * @param  length  the number of integers to read.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final int[] dest, final int offset, final int length) throws IOException {
         new IntsReader(dest).readFully(null, offset, length);
@@ -774,10 +774,10 @@ public class ChannelDataInput extends Ch
      * Reads {@code length} long integers from the stream, and stores them into
      * {@code dest} starting at index {@code offset}.
      *
-     * @param  dest   An array of long integers to be written to.
-     * @param  offset The starting position within {@code dest} to write.
-     * @param  length The number of long integers to read.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @param  dest    an array of long integers to be written to.
+     * @param  offset  the starting position within {@code dest} to write.
+     * @param  length  the number of long integers to read.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final long[] dest, final int offset, final int length) throws IOException {
         new LongsReader(dest).readFully(null, offset, length);
@@ -787,10 +787,10 @@ public class ChannelDataInput extends Ch
      * Reads {@code length} floats from the stream, and stores them into
      * {@code dest} starting at index {@code offset}.
      *
-     * @param  dest   An array of floats to be written to.
-     * @param  offset The starting position within {@code dest} to write.
-     * @param  length The number of floats to read.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @param  dest    an array of floats to be written to.
+     * @param  offset  the starting position within {@code dest} to write.
+     * @param  length  the number of floats to read.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final float[] dest, final int offset, final int length) throws IOException {
         new FloatsReader(dest).readFully(null, offset, length);
@@ -800,10 +800,10 @@ public class ChannelDataInput extends Ch
      * Reads {@code length} doubles from the stream, and stores them into
      * {@code dest} starting at index {@code offset}.
      *
-     * @param  dest   An array of doubles to be written to.
-     * @param  offset The starting position within {@code dest} to write.
-     * @param  length The number of doubles to read.
-     * @throws IOException If an error (including EOF) occurred while reading the stream.
+     * @param  dest    an array of doubles to be written to.
+     * @param  offset  the starting position within {@code dest} to write.
+     * @param  length  the number of doubles to read.
+     * @throws IOException if an error (including EOF) occurred while reading the stream.
      */
     public final void readFully(final double[] dest, final int offset, final int length) throws IOException {
         new DoublesReader(dest).readFully(null, offset, length);
@@ -817,10 +817,10 @@ public class ChannelDataInput extends Ch
      * to decode, for example attribute values in the file header. For large amount of data, consider using
      * {@link java.nio.charset.CharsetDecoder} instead.</p>
      *
-     * @param  length   Number of bytes to read.
-     * @param  encoding The character encoding.
-     * @return The string decoded from the {@code length} next bytes.
-     * @throws IOException If an error occurred while reading the bytes, or if the given encoding is invalid.
+     * @param  length    number of bytes to read.
+     * @param  encoding  the character encoding.
+     * @return the string decoded from the {@code length} next bytes.
+     * @throws IOException if an error occurred while reading the bytes, or if the given encoding is invalid.
      */
     public final String readString(final int length, final String encoding) throws IOException {
         if (buffer.hasArray() && length <= buffer.capacity()) {
@@ -836,8 +836,8 @@ public class ChannelDataInput extends Ch
     /**
      * Moves to the given position in the stream, relative to the stream position at construction time.
      *
-     * @param  position The position where to move.
-     * @throws IOException If the stream can not be moved to the given position.
+     * @param  position  the position where to move.
+     * @throws IOException if the stream can not be moved to the given position.
      */
     @Override
     public final void seek(final long position) throws IOException {
@@ -878,8 +878,7 @@ public class ChannelDataInput extends Ch
             buffer.position((int) p);
         } else {
             /*
-             * Requested position is before the current buffer limits
-             * and we can not seek.
+             * Requested position is before the current buffer limits and we can not seek.
              */
             throw new IOException(Errors.format(Errors.Keys.StreamIsForwardOnly_1, filename));
         }

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -22,6 +22,7 @@ import java.io.IOException;
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.util.Debug;
 
 
@@ -33,7 +34,7 @@ import org.apache.sis.util.Debug;
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class HyperRectangleReader {
@@ -66,7 +67,7 @@ public final class HyperRectangleReader
             case Numbers.LONG:      reader = input.new LongsReader  ((long[])   null); break;
             case Numbers.FLOAT:     reader = input.new FloatsReader ((float[])  null); break;
             case Numbers.DOUBLE:    reader = input.new DoublesReader((double[]) null); break;
-            default: throw new DataStoreException(Errors.format(Errors.Keys.UnknownType_1, dataType));
+            default: throw new DataStoreContentException(Errors.format(Errors.Keys.UnknownType_1, dataType));
         }
         this.origin = origin;
         final ByteBuffer buffer = input.buffer;

Copied: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java (from r1755594, sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java?p2=sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java&p1=sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java&r1=1755594&r2=1755610&rev=1755610&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -46,7 +46,7 @@ import org.apache.sis.util.Utilities;
 import org.apache.sis.util.iso.Types;
 
 // Branch-dependent imports
-import java.time.LocalDate;
+import org.apache.sis.internal.jdk8.LocalDate;
 
 
 /**

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/csv/Store.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -29,6 +29,7 @@ import java.io.BufferedReader;
 import java.io.LineNumberReader;
 import java.io.IOException;
 import java.net.URI;
+import java.nio.charset.Charset;
 import javax.measure.unit.Unit;
 import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
@@ -43,11 +44,12 @@ import org.apache.sis.feature.DefaultFea
 import org.apache.sis.referencing.CRS;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.internal.referencing.GeodeticObjectBuilder;
-import org.apache.sis.internal.storage.MetadataHelper;
+import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.geometry.GeneralEnvelope;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.util.ArraysExt;
 import org.apache.sis.util.CharSequences;
@@ -63,6 +65,7 @@ import org.opengis.feature.Feature;
 import org.opengis.feature.FeatureType;
 import org.opengis.feature.PropertyType;
 import org.opengis.feature.AttributeType;
+import org.apache.sis.setup.OptionKey;
 
 
 /**
@@ -71,7 +74,7 @@ import org.opengis.feature.AttributeType
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 public final class Store extends DataStore {
@@ -118,9 +121,14 @@ public final class Store extends DataSto
     private BufferedReader source;
 
     /**
-     * The metadata object. Initialized to a minimal amount of information, then completed when first needed.
+     * The character encoding, or {@code null} if unspecified (in which case the platform default is assumed).
      */
-    private final DefaultMetadata metadata;
+    private final Charset encoding;
+
+    /**
+     * The metadata object, or {@code null} if not yet created.
+     */
+    private transient DefaultMetadata metadata;
 
     /**
      * The three- or four-dimensional envelope together with the CRS.
@@ -197,14 +205,14 @@ public final class Store extends DataSto
                 switch (keyword.toLowerCase(Locale.US)) {
                     case "@stboundedby": {
                         if (envelope != null) {
-                            throw new DataStoreException(duplicated("@stboundedby"));
+                            throw new DataStoreContentException(duplicated("@stboundedby"));
                         }
                         envelope = parseEnvelope(elements);
                         break;
                     }
                     case "@columns": {
                         if (featureType != null) {
-                            throw new DataStoreException(duplicated("@columns"));
+                            throw new DataStoreContentException(duplicated("@columns"));
                         }
                         featureType = parseFeatureType(elements);
                         if (foliation == null) {
@@ -214,7 +222,7 @@ public final class Store extends DataSto
                     }
                     case "@foliation": {
                         if (foliation != null) {
-                            throw new DataStoreException(duplicated("@foliation"));
+                            throw new DataStoreContentException(duplicated("@foliation"));
                         }
                         foliation = parseFoliation(elements);
                         break;
@@ -234,10 +242,10 @@ public final class Store extends DataSto
         } catch (IOException | FactoryException | IllegalArgumentException | DateTimeException e) {
             throw new DataStoreException(errors().getString(Errors.Keys.CanNotParseFile_2, "CSV", name), e);
         }
+        this.encoding    = connector.getOption(OptionKey.ENCODING);
         this.envelope    = envelope;
         this.featureType = featureType;
         this.foliation   = foliation;
-        this.metadata    = MetadataHelper.createForTextFile(connector);
         this.features    = new ArrayList<>();
     }
 
@@ -274,7 +282,7 @@ public final class Store extends DataSto
                         case "hour":     timeUnit = NonSI.HOUR;   break;
                         case "day":      timeUnit = NonSI.DAY;    break;
                         case "absolute": isTimeAbsolute = true;   break;
-                        default: throw new DataStoreException(errors().getString(Errors.Keys.UnknownUnit_1, unit));
+                        default: throw new DataStoreContentException(errors().getString(Errors.Keys.UnknownUnit_1, unit));
                     }
                     // Fall through
             case 7: endTime     = Instant      .parse(       elements.get(6));
@@ -286,7 +294,7 @@ public final class Store extends DataSto
                         case "":   // Default to 2D.
                         case "2D": break;
                         case "3D": is3D = true; break;
-                        default: throw new DataStoreException(errors().getString(
+                        default: throw new DataStoreContentException(errors().getString(
                                         Errors.Keys.IllegalCoordinateSystem_1, dimension));
                     }
                     // Fall through
@@ -337,7 +345,7 @@ public final class Store extends DataSto
                 if ((dim = lowerCorner.length) != spatialDimension ||
                     (dim = upperCorner.length) != spatialDimension)
                 {
-                    throw new DataStoreException(errors().getString(
+                    throw new DataStoreContentException(errors().getString(
                             Errors.Keys.MismatchedDimension_2, dim, spatialDimension));
                 }
                 for (int i=0; i<spatialDimension; i++) {
@@ -381,7 +389,7 @@ public final class Store extends DataSto
                         case "string":   type = String .class; break;
                         case "datetime": type = Instant.class; break;
                         case "anyuri":   type = URI    .class; break;
-                        default: throw new DataStoreException(errors().getString(Errors.Keys.UnknownType_1, tn));
+                        default: throw new DataStoreContentException(errors().getString(Errors.Keys.UnknownType_1, tn));
                     }
                 }
             }
@@ -455,13 +463,15 @@ public final class Store extends DataSto
      */
     @Override
     public Metadata getMetadata() throws DataStoreException {
-        if (metadata.isModifiable()) {
+        if (metadata == null) {
+            final MetadataBuilder builder = new MetadataBuilder();
+            builder.add(encoding);
             try {
-                MetadataHelper.add(metadata, envelope);
+                builder.add(envelope);
             } catch (TransformException e) {
-                throw new DataStoreException(errors().getString(Errors.Keys.CanNotParseFile_2, "CSV", name), e);
+                throw new DataStoreContentException(errors().getString(Errors.Keys.CanNotParseFile_2, "CSV", name), e);
             }
-            metadata.freeze();
+            metadata = builder.result();
         }
         return metadata;
     }
@@ -514,7 +524,7 @@ public final class Store extends DataSto
                          *   Column 1 is the start time.
                          *   Column 2 is the end time.
                          *   Column 3 is the trajectory.
-                         *   Columns 4+ are custum attributes.
+                         *   Columns 4+ are custom attributes.
                          *
                          * TODO: we should replace that switch case by custom ObjectConverter.
                          */

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/wkt/Store.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -32,6 +32,7 @@ import org.apache.sis.io.wkt.Warnings;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.CharSequences;
@@ -44,7 +45,7 @@ import org.apache.sis.referencing.CRS;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
- * @version 0.7
+ * @version 0.8
  * @module
  */
 final class Store extends DataStore {
@@ -103,7 +104,7 @@ final class Store extends DataStore {
                 while ((n = in.read(buffer, length, buffer.length - length)) >= 0) {
                     if ((length += n) >= buffer.length) {
                         if (n >= Integer.MAX_VALUE / 1024) {     // Arbitrary size limit.
-                            throw new DataStoreException(Errors.format(Errors.Keys.ExcessiveStringSize));
+                            throw new DataStoreContentException(Errors.format(Errors.Keys.ExcessiveStringSize));
                         }
                         buffer = Arrays.copyOf(buffer, n << 1);
                     }

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreException.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -41,7 +41,7 @@ public class DataStoreException extends
     /**
      * Creates an exception with the specified details message.
      *
-     * @param message The detail message.
+     * @param message  the detail message.
      */
     public DataStoreException(final String message) {
         super(message);
@@ -50,7 +50,7 @@ public class DataStoreException extends
     /**
      * Creates an exception with the specified cause and no details message.
      *
-     * @param cause The cause for this exception.
+     * @param cause  the cause for this exception.
      */
     public DataStoreException(final Throwable cause) {
         super(cause);
@@ -59,8 +59,8 @@ public class DataStoreException extends
     /**
      * Creates an exception with the specified details message and cause.
      *
-     * @param message The detail message.
-     * @param cause The cause for this exception.
+     * @param message  the detail message.
+     * @param cause    the cause for this exception.
      */
     public DataStoreException(final String message, final Throwable cause) {
         super(message, cause);

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/storage/UnsupportedStorageException.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -41,7 +41,7 @@ public class UnsupportedStorageException
     /**
      * Creates an exception with the specified details message.
      *
-     * @param message The detail message.
+     * @param message  the detail message.
      */
     public UnsupportedStorageException(final String message) {
         super(message);
@@ -50,7 +50,7 @@ public class UnsupportedStorageException
     /**
      * Creates an exception with the specified cause and no details message.
      *
-     * @param cause The cause for this exception.
+     * @param cause  the cause for this exception.
      */
     public UnsupportedStorageException(final Throwable cause) {
         super(cause);
@@ -59,8 +59,8 @@ public class UnsupportedStorageException
     /**
      * Creates an exception with the specified details message and cause.
      *
-     * @param message The detail message.
-     * @param cause The cause for this exception.
+     * @param message  the detail message.
+     * @param cause    the cause for this exception.
      */
     public UnsupportedStorageException(final String message, final Throwable cause) {
         super(message, cause);

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java?rev=1755610&r1=1755609&r2=1755610&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/test/suite/StorageTestSuite.java [UTF-8] Tue Aug  9 14:48:04 2016
@@ -37,6 +37,7 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.storage.ChannelImageInputStreamTest.class,
     org.apache.sis.internal.storage.ChannelImageOutputStreamTest.class,
     org.apache.sis.internal.storage.HyperRectangleReaderTest.class,
+    org.apache.sis.internal.storage.MetadataBuilderTest.class,
     org.apache.sis.storage.ProbeResultTest.class,
     org.apache.sis.storage.StorageConnectorTest.class,
     org.apache.sis.internal.storage.xml.MimeTypeDetectorTest.class,



Mime
View raw message