sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlebi...@apache.org
Subject svn commit: r1678851 - in /sis/branches/JDK8/storage: sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/ sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/...
Date Tue, 12 May 2015 02:58:45 GMT
Author: mlebihan
Date: Tue May 12 02:58:44 2015
New Revision: 1678851

URL: http://svn.apache.org/r1678851
Log:
SIS-189 : InvalidDbaseFileFormatException should extend DataStoreException

    Shapefile findAll() method now throw exceptions InvalidDbaseFileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException, InvalidShapefileFormatException extending DataStoreException

    InputFeatureStream used by Shapefile to return Feature now returns only few exceptions extending DataStoreException, of three kind :
    DataStoreClosedException if the current connection used to query the shapefile has been closed.
    DataStoreQueryException if the statement used to query the shapefile content is incorrect.
    DataStoreQueryResultException if the shapefile content cause a trouble (wrong format, for example).

Callers of Shapefile public methods won't have to handle SQLException anymore.

Added:
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLShapefileNotFoundException.java
      - copied, changed from r1678848, sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileNotFoundException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLDbaseFileNotFoundException.java
      - copied, changed from r1678848, sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DbaseFileNotFoundException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLInvalidDbaseFileFormatException.java
      - copied, changed from r1678848, sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/InvalidDbaseFileFormatException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryResultException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DbaseFileNotFoundException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidDbaseFileFormatException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidShapefileFormatException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapefileNotFoundException.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java
Removed:
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/InvalidShapefileFormatException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileNotFoundException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DbaseFileNotFoundException.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/InvalidDbaseFileFormatException.java
Modified:
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java
    sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties
    sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties
    sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java

Copied: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLShapefileNotFoundException.java (from r1678848, sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileNotFoundException.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLShapefileNotFoundException.java?p2=sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLShapefileNotFoundException.java&p1=sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileNotFoundException.java&r1=1678848&r2=1678851&rev=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileNotFoundException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLShapefileNotFoundException.java [UTF-8] Tue May 12 02:58:44 2015
@@ -27,7 +27,7 @@ import java.sql.SQLNonTransientException
  * @since   0.5
  * @module
  */
-public class ShapefileNotFoundException extends SQLNonTransientException {
+public class SQLShapefileNotFoundException extends SQLNonTransientException {
     /** Serial UID. */
     private static final long serialVersionUID = -3235671561698931817L;
 
@@ -35,7 +35,7 @@ public class ShapefileNotFoundException
      * Construct an exception.
      * @param message Message of the exception.
      */
-    public ShapefileNotFoundException(String message) {
+    public SQLShapefileNotFoundException(String message) {
         super(message);
     }
 
@@ -44,7 +44,7 @@ public class ShapefileNotFoundException
      * @param message Message of the exception.
      * @param cause Root cause of the exception.
      */
-    public ShapefileNotFoundException(String message, Throwable cause) {
+    public SQLShapefileNotFoundException(String message, Throwable cause) {
         super(message, cause);
     }
 }

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/ShapefileByteReader.java [UTF-8] Tue May 12 02:58:44 2015
@@ -25,6 +25,7 @@ import java.util.*;
 import org.apache.sis.feature.DefaultAttributeType;
 import org.apache.sis.feature.DefaultFeatureType;
 import org.apache.sis.internal.shapefile.jdbc.*;
+import org.apache.sis.storage.shapefile.InvalidShapefileFormatException;
 import org.apache.sis.storage.shapefile.ShapeTypeEnum;
 import org.opengis.feature.Feature;
 
@@ -38,7 +39,7 @@ import com.esri.core.geometry.*;
  * @since   0.5
  * @module
  */
-public class ShapefileByteReader extends CommonByteReader<InvalidShapefileFormatException, ShapefileNotFoundException> {
+public class ShapefileByteReader extends CommonByteReader<InvalidShapefileFormatException, SQLShapefileNotFoundException> {
     /** Name of the Geometry field. */
     private static final String GEOMETRY_NAME = "geometry";
 
@@ -56,12 +57,12 @@ public class ShapefileByteReader extends
      * @param shapefile Shapefile.
      * @param dbaseFile underlying database file name.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws InvalidDbaseFileFormatException if the database file format is invalid.
-     * @throws ShapefileNotFoundException if the shapefile has not been found.
-     * @throws DbaseFileNotFoundException if the database file has not been found.
+     * @throws SQLInvalidDbaseFileFormatException if the database file format is invalid.
+     * @throws SQLShapefileNotFoundException if the shapefile has not been found.
+     * @throws SQLDbaseFileNotFoundException if the database file has not been found.
      */
-    public ShapefileByteReader(File shapefile, File dbaseFile) throws InvalidShapefileFormatException, InvalidDbaseFileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException {
-        super(shapefile, InvalidShapefileFormatException.class, ShapefileNotFoundException.class);
+    public ShapefileByteReader(File shapefile, File dbaseFile) throws InvalidShapefileFormatException, SQLInvalidDbaseFileFormatException, SQLShapefileNotFoundException, SQLDbaseFileNotFoundException {
+        super(shapefile, InvalidShapefileFormatException.class, SQLShapefileNotFoundException.class);
         loadDatabaseFieldDescriptors(dbaseFile);
         loadDescriptor();
 
@@ -129,10 +130,10 @@ public class ShapefileByteReader extends
     /**
      * Load database field descriptors.
      * @param dbaseFile Database file.
-     * @throws InvalidDbaseFileFormatException if the database format is incorrect.
-     * @throws DbaseFileNotFoundException if the database file cannot be found.
+     * @throws SQLInvalidDbaseFileFormatException if the database format is incorrect.
+     * @throws SQLDbaseFileNotFoundException if the database file cannot be found.
      */
-    private void loadDatabaseFieldDescriptors(File dbaseFile) throws InvalidDbaseFileFormatException, DbaseFileNotFoundException {
+    private void loadDatabaseFieldDescriptors(File dbaseFile) throws SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException {
         MappedByteReader databaseReader = null;
 
         try {

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/AbstractDbase3ByteReader.java [UTF-8] Tue May 12 02:58:44 2015
@@ -32,7 +32,7 @@ import java.util.logging.Level;
  * @since   0.5
  * @module
  */
-abstract class AbstractDbase3ByteReader extends CommonByteReader<InvalidDbaseFileFormatException, DbaseFileNotFoundException> implements Dbase3ByteReader {
+abstract class AbstractDbase3ByteReader extends CommonByteReader<SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException> implements Dbase3ByteReader {
     /** Number of bytes in the header. */
     protected short dbaseHeaderBytes;
 
@@ -92,11 +92,11 @@ abstract class AbstractDbase3ByteReader
     /**
      * Map a dbf file.
      * @param file Database file.
-     * @throws DbaseFileNotFoundException if the DBF file has not been found.
-     * @throws InvalidDbaseFileFormatException if the database has an invalid format.
+     * @throws SQLDbaseFileNotFoundException if the DBF file has not been found.
+     * @throws SQLInvalidDbaseFileFormatException if the database has an invalid format.
      */
-    public AbstractDbase3ByteReader(File file) throws DbaseFileNotFoundException, InvalidDbaseFileFormatException {
-        super(file, InvalidDbaseFileFormatException.class, DbaseFileNotFoundException.class);
+    public AbstractDbase3ByteReader(File file) throws SQLDbaseFileNotFoundException, SQLInvalidDbaseFileFormatException {
+        super(file, SQLInvalidDbaseFileFormatException.class, SQLDbaseFileNotFoundException.class);
     }
 
     /**
@@ -135,11 +135,11 @@ abstract class AbstractDbase3ByteReader
      * Convert the binary code page value of the Dbase 3 file to a recent Charset.
      * @param codePageBinaryValue page code binary value.
      * @return Charset.
-     * @throws InvalidDbaseFileFormatException if the binary value is not one of the standard values that the DBF file should carry : the Dbase 3
+     * @throws SQLInvalidDbaseFileFormatException if the binary value is not one of the standard values that the DBF file should carry : the Dbase 3
      * file might be corrupted.
      * @throws UnsupportedCharsetException if the code page as no representation in recents Charset (legacy DOS or macintosh charsets).
      */
-    protected Charset toCharset(byte codePageBinaryValue) throws InvalidDbaseFileFormatException, UnsupportedCharsetException {
+    protected Charset toCharset(byte codePageBinaryValue) throws SQLInvalidDbaseFileFormatException, UnsupportedCharsetException {
         // Attempt to find a known conversion.
         String dbfCodePage = toCodePage(codePageBinaryValue);
 
@@ -162,7 +162,7 @@ abstract class AbstractDbase3ByteReader
         // If the code page is invalid, the database itself has chances to be invalid too.
         if (dbfCodePage.equals("invalid")) {
             String message = format(Level.WARNING, "excp.illegal_codepage", codePageBinaryValue, getFile().getAbsolutePath());
-            throw new InvalidDbaseFileFormatException(message);
+            throw new SQLInvalidDbaseFileFormatException(message);
         }
 
         // If the code page cannot find a match for a more recent Charset, we wont be able to handle this DBF.

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DBFDriver.java [UTF-8] Tue May 12 02:58:44 2015
@@ -63,13 +63,13 @@ public class DBFDriver extends AbstractJ
      * @param  url  The path to a {@code .dbf} file.
      * @param  info Ignored in current implementation.
      * @return A connection to the given DBF file.
-     * @throws InvalidDbaseFileFormatException if the database file format is invalid.
-     * @throws DbaseFileNotFoundException if the database file doesn't exist.
-     * @throws InvalidDbaseFileFormatException if the database file has a wrong format.
+     * @throws SQLInvalidDbaseFileFormatException if the database file format is invalid.
+     * @throws SQLDbaseFileNotFoundException if the database file doesn't exist.
+     * @throws SQLInvalidDbaseFileFormatException if the database file has a wrong format.
      */
     @Override
     @SuppressWarnings("resource") // the function opens a connection.
-    public Connection connect(final String url, @SuppressWarnings("unused") Properties info) throws InvalidDbaseFileFormatException, DbaseFileNotFoundException {
+    public Connection connect(final String url, @SuppressWarnings("unused") Properties info) throws SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException {
         Objects.requireNonNull(url, "the DBase3 url cannot be null");
         File file = new File(url);
 

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/MappedByteReader.java [UTF-8] Tue May 12 02:58:44 2015
@@ -42,10 +42,10 @@ public class MappedByteReader extends Ab
     /**
      * Construct a mapped byte reader on a file.
      * @param dbase3File File.
-     * @throws InvalidDbaseFileFormatException if the database seems to be invalid.
-     * @throws DbaseFileNotFoundException if the Dbase file has not been found.
+     * @throws SQLInvalidDbaseFileFormatException if the database seems to be invalid.
+     * @throws SQLDbaseFileNotFoundException if the Dbase file has not been found.
      */
-    public MappedByteReader(File dbase3File) throws InvalidDbaseFileFormatException, DbaseFileNotFoundException {
+    public MappedByteReader(File dbase3File) throws SQLInvalidDbaseFileFormatException, SQLDbaseFileNotFoundException {
         super(dbase3File);
         loadDescriptor();
     }
@@ -115,9 +115,9 @@ public class MappedByteReader extends Ab
 
     /**
      * Loading the database file content from binary .dbf file.
-     * @throws InvalidDbaseFileFormatException if descriptor is not readable.
+     * @throws SQLInvalidDbaseFileFormatException if descriptor is not readable.
      */
-    private void loadDescriptor() throws InvalidDbaseFileFormatException {
+    private void loadDescriptor() throws SQLInvalidDbaseFileFormatException {
         try {
             this.dbaseVersion = getByteBuffer().get();
             getByteBuffer().get(this.dbaseLastUpdate);
@@ -152,7 +152,7 @@ public class MappedByteReader extends Ab
             // If the last character read after the field descriptor isn't 0x0D, the expected mark has not been found and the DBF is corrupted.
             if (descriptorTerminator != 0x0D) {
                 String message = format(Level.WARNING, "excp.filedescriptor_problem", getFile().getAbsolutePath(), "Character marking the end of the fields descriptors (0x0D) has not been found.");
-                throw new InvalidDbaseFileFormatException(message);
+                throw new SQLInvalidDbaseFileFormatException(message);
             }
         }
         catch(BufferUnderflowException e) {
@@ -161,7 +161,7 @@ public class MappedByteReader extends Ab
             // Therefore, an internal structure problem cause maybe a premature End of file or anything else, but the only thing
             // we can conclude is : we are not before a device trouble, but a file format trouble.
             String message = format(Level.WARNING, "excp.filedescriptor_problem", getFile().getAbsolutePath(), e.getMessage());
-            throw new InvalidDbaseFileFormatException(message);
+            throw new SQLInvalidDbaseFileFormatException(message);
         }
     }
 

Copied: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLDbaseFileNotFoundException.java (from r1678848, sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DbaseFileNotFoundException.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLDbaseFileNotFoundException.java?p2=sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLDbaseFileNotFoundException.java&p1=sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DbaseFileNotFoundException.java&r1=1678848&r2=1678851&rev=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/DbaseFileNotFoundException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLDbaseFileNotFoundException.java [UTF-8] Tue May 12 02:58:44 2015
@@ -27,7 +27,7 @@ import java.sql.SQLNonTransientException
  * @since   0.5
  * @module
  */
-public class DbaseFileNotFoundException extends SQLNonTransientException {
+public class SQLDbaseFileNotFoundException extends SQLNonTransientException {
     /** Serial UID. */
     private static final long serialVersionUID = 2572691456125734352L;
 
@@ -35,7 +35,7 @@ public class DbaseFileNotFoundException
      * Construct an exception.
      * @param message Message of the exception.
      */
-    public DbaseFileNotFoundException(String message) {
+    public SQLDbaseFileNotFoundException(String message) {
         super(message);
     }
 
@@ -44,7 +44,7 @@ public class DbaseFileNotFoundException
      * @param message Message of the exception.
      * @param cause Root cause of the exception.
      */
-    public DbaseFileNotFoundException(String message, Throwable cause) {
+    public SQLDbaseFileNotFoundException(String message, Throwable cause) {
         super(message, cause);
     }
 }

Copied: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLInvalidDbaseFileFormatException.java (from r1678848, sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/InvalidDbaseFileFormatException.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLInvalidDbaseFileFormatException.java?p2=sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLInvalidDbaseFileFormatException.java&p1=sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/InvalidDbaseFileFormatException.java&r1=1678848&r2=1678851&rev=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/InvalidDbaseFileFormatException.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/SQLInvalidDbaseFileFormatException.java [UTF-8] Tue May 12 02:58:44 2015
@@ -27,7 +27,7 @@ import java.sql.SQLNonTransientException
  * @since   0.5
  * @module
  */
-public class InvalidDbaseFileFormatException extends SQLNonTransientException {
+public class SQLInvalidDbaseFileFormatException extends SQLNonTransientException {
     /** Serial UID. */
     private static final long serialVersionUID = 3924612615300490837L;
 
@@ -35,7 +35,7 @@ public class InvalidDbaseFileFormatExcep
      * Construct an exception.
      * @param message Message of the exception.
      */
-    public InvalidDbaseFileFormatException(String message) {
+    public SQLInvalidDbaseFileFormatException(String message) {
         super(message);
     }
 
@@ -44,7 +44,7 @@ public class InvalidDbaseFileFormatExcep
      * @param message Message of the exception.
      * @param cause Root cause of the exception.
      */
-    public InvalidDbaseFileFormatException(String message, Throwable cause) {
+    public SQLInvalidDbaseFileFormatException(String message, Throwable cause) {
         super(message, cause);
     }
 }

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.java [UTF-8] Tue May 12 02:58:44 2015
@@ -51,17 +51,17 @@ public class DBFConnection extends Abstr
      * Constructs a connection to the given database.
      * @param datafile Data file ({@code .dbf} extension).
      * @param br Byte reader to use for reading binary content.
-     * @throws DbaseFileNotFoundException if the Database file cannot be found or is not a file.
+     * @throws SQLDbaseFileNotFoundException if the Database file cannot be found or is not a file.
      */
-    public DBFConnection(final File datafile, Dbase3ByteReader br) throws DbaseFileNotFoundException {
+    public DBFConnection(final File datafile, Dbase3ByteReader br) throws SQLDbaseFileNotFoundException {
         // Check that file exists.
         if (!datafile.exists()) {
-            throw new DbaseFileNotFoundException(format(Level.WARNING, "excp.file_not_found", datafile.getAbsolutePath()));
+            throw new SQLDbaseFileNotFoundException(format(Level.WARNING, "excp.file_not_found", datafile.getAbsolutePath()));
         }
 
         // Check that its not a directory.
         if (datafile.isDirectory()) {
-            throw new DbaseFileNotFoundException(format(Level.WARNING, "excp.directory_not_expected", datafile.getAbsolutePath()));
+            throw new SQLDbaseFileNotFoundException(format(Level.WARNING, "excp.directory_not_expected", datafile.getAbsolutePath()));
         }
 
        databaseFile = datafile;

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.java [UTF-8] Tue May 12 02:58:44 2015
@@ -391,8 +391,17 @@ public class DBFRecordBasedResultSet ext
      * @see org.apache.sis.internal.shapefile.jdbc.resultset.DBFResultSet#getObject(java.lang.String)
      */
     @Override
-    public Object getObject(String columnLabel) throws SQLConnectionClosedException, SQLIllegalColumnIndexException, SQLFeatureNotSupportedException, SQLNoSuchFieldException, SQLNotNumericException, SQLNotDateException {
-        return getObject(findColumn(columnLabel));
+    public Object getObject(String columnLabel) throws SQLConnectionClosedException, SQLFeatureNotSupportedException, SQLNoSuchFieldException, SQLNotNumericException, SQLNotDateException {
+        int index = -1;
+        
+        try {
+            index = findColumn(columnLabel);
+            return getObject(index);
+        }
+        catch(SQLIllegalColumnIndexException e) {
+            String message = format(Level.SEVERE, "assert.wrong_index_for_column_name", index, columnLabel);
+            throw new RuntimeException(message, e);
+        }
     }
 
     /**

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryException.java?rev=1678851&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryException.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryException.java Tue May 12 02:58:44 2015
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.shapefile;
+
+import org.apache.sis.storage.DataStoreException;
+
+
+/**
+ * Thrown when a query is invalid.
+ *
+ * @author  Marc Le Bihan
+ * @version 0.6
+ * @since   0.6
+ * @module
+ */
+public class DataStoreQueryException extends DataStoreException {
+    /** Serial UID. */
+    private static final long serialVersionUID = 6927412997473246611L;
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     */
+    public DataStoreQueryException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public DataStoreQueryException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryResultException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryResultException.java?rev=1678851&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryResultException.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DataStoreQueryResultException.java Tue May 12 02:58:44 2015
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.shapefile;
+
+import org.apache.sis.storage.DataStoreException;
+
+
+/**
+ * Thrown when a query result is invalid (for example : because the data found has a wrong format).
+ *
+ * @author  Marc Le Bihan
+ * @version 0.6
+ * @since   0.6
+ * @module
+ */
+public class DataStoreQueryResultException extends DataStoreException {
+    /** Serial UID. */
+    private static final long serialVersionUID = 8397640365245240930L;
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     */
+    public DataStoreQueryResultException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public DataStoreQueryResultException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DbaseFileNotFoundException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DbaseFileNotFoundException.java?rev=1678851&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DbaseFileNotFoundException.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/DbaseFileNotFoundException.java Tue May 12 02:58:44 2015
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.shapefile;
+
+import org.apache.sis.storage.DataStoreException;
+
+
+/**
+ * Thrown when a DBF file has not been found.
+ *
+ * @author  Marc Le Bihan
+ * @version 0.6
+ * @since   0.6
+ * @module
+ */
+public class DbaseFileNotFoundException extends DataStoreException {
+    /** Serial UID. */
+    private static final long serialVersionUID = 5930300852780537859L;
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     */
+    public DbaseFileNotFoundException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public DbaseFileNotFoundException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InputFeatureStream.java [UTF-8] Tue May 12 02:58:44 2015
@@ -19,12 +19,12 @@ package org.apache.sis.storage.shapefile
 import java.io.File;
 import java.io.InputStream;
 import java.sql.SQLFeatureNotSupportedException;
-import java.text.*;
+import java.text.DecimalFormat;
+import java.text.MessageFormat;
 
 import org.apache.sis.feature.DefaultFeatureType;
-import org.apache.sis.internal.shapefile.InvalidShapefileFormatException;
+import org.apache.sis.internal.shapefile.SQLShapefileNotFoundException;
 import org.apache.sis.internal.shapefile.ShapefileByteReader;
-import org.apache.sis.internal.shapefile.ShapefileNotFoundException;
 import org.apache.sis.internal.shapefile.jdbc.*;
 import org.apache.sis.internal.shapefile.jdbc.connection.DBFConnection;
 import org.apache.sis.internal.shapefile.jdbc.metadata.DBFDatabaseMetaData;
@@ -33,6 +33,7 @@ import org.apache.sis.internal.shapefile
 import org.apache.sis.internal.shapefile.jdbc.sql.SQLInvalidStatementException;
 import org.apache.sis.internal.shapefile.jdbc.sql.SQLUnsupportedParsingFeatureException;
 import org.apache.sis.internal.shapefile.jdbc.statement.DBFStatement;
+import org.apache.sis.storage.DataStoreClosedException;
 import org.opengis.feature.Feature;
 
 /**
@@ -75,27 +76,44 @@ public class InputFeatureStream extends
      * Create an input stream of features over a connection.
      * @param shpfile Shapefile.
      * @param dbaseFile Database file.
-     * @throws SQLInvalidStatementException if the given SQL Statement is invalid.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
      * @throws InvalidDbaseFileFormatException if the Dbase file format is invalid.
      * @throws ShapefileNotFoundException if the shapefile has not been found.
      * @throws DbaseFileNotFoundException if the database file has not been found.
      */
-    public InputFeatureStream(File shpfile, File dbaseFile) throws SQLInvalidStatementException, InvalidDbaseFileFormatException, InvalidShapefileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException {
-        connection = (DBFConnection)new DBFDriver().connect(dbaseFile.getAbsolutePath(), null);
-        sql = MessageFormat.format("SELECT * FROM {0}", dbaseFile.getName());
-        shapefile = shpfile;
-        databaseFile = dbaseFile;
-
-        shapefileReader = new ShapefileByteReader(shapefile, databaseFile);
-        featuresType = shapefileReader.getFeaturesType();
-
+    public InputFeatureStream(File shpfile, File dbaseFile) throws InvalidDbaseFileFormatException, InvalidShapefileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException {
         try {
-            executeQuery();
+            connection = (DBFConnection)new DBFDriver().connect(dbaseFile.getAbsolutePath(), null);
+            sql = MessageFormat.format("SELECT * FROM {0}", dbaseFile.getName());
+            shapefile = shpfile;
+            databaseFile = dbaseFile;
+    
+            shapefileReader = new ShapefileByteReader(shapefile, databaseFile);
+            featuresType = shapefileReader.getFeaturesType();
+    
+            try {
+                executeQuery();
+            }
+            catch(SQLConnectionClosedException e) {
+                // This would be an internal trouble because in this function (at least) it should be open.
+                throw new RuntimeException(e.getMessage(), e);
+            }
+            catch(SQLInvalidStatementException e) {
+                // This would be an internal trouble because if any SQL statement is executed for the dbase file initialization, it should has a correct syntax or grammar.
+                throw new RuntimeException(e.getMessage(), e);
+            }
         }
-        catch(SQLConnectionClosedException e) {
-            // This would be an internal trouble because in this function (at least) it should be open.
-            throw new RuntimeException(e.getMessage(), e);
+        catch(SQLInvalidDbaseFileFormatException ex) {
+            // Promote this exception to an DataStoreException compatible exception.
+            throw new InvalidDbaseFileFormatException(ex.getMessage(), ex);
+        }
+        catch(SQLDbaseFileNotFoundException ex) {
+            // Promote this exception to an DataStoreException compatible exception.
+            throw new DbaseFileNotFoundException(ex.getMessage(), ex);
+        }
+        catch(SQLShapefileNotFoundException ex) {
+            // Promote this exception to an DataStoreException compatible exception.
+            throw new ShapefileNotFoundException(ex.getMessage(), ex);
         }
     }
 
@@ -126,7 +144,30 @@ public class InputFeatureStream extends
     }
 
     /**
-     * Read next feature responding to the SQL request.
+     * Read next feature responding to the SQL query.
+     * @return Feature, null if no more feature is available.
+     * @throws DataStoreClosedException if the current connection used to query the shapefile has been closed.
+     * @throws DataStoreQueryException if the statement used to query the shapefile content is incorrect.
+     * @throws DataStoreQueryResultException if the shapefile results cause a trouble (wrong format, for example).
+     * @throws InvalidShapefileFormatException if the shapefile structure shows a problem.
+     */
+    public Feature readFeature() throws DataStoreClosedException, DataStoreQueryException, DataStoreQueryResultException, InvalidShapefileFormatException {
+        try {
+            return internalReadFeature();
+        }
+        catch(SQLConnectionClosedException e) {
+            throw new DataStoreClosedException(e.getMessage(), e);
+        }
+        catch(SQLInvalidStatementException | SQLIllegalParameterException | SQLNoSuchFieldException | SQLUnsupportedParsingFeatureException | SQLFeatureNotSupportedException e) {
+            throw new DataStoreQueryException(e.getMessage(), e);
+        }
+        catch(SQLNotNumericException | SQLNotDateException e) {
+            throw new DataStoreQueryResultException(e.getMessage(), e);
+        }
+    }
+    
+    /**
+     * Read next feature responding to the SQL query.
      * @return Feature, null if no more feature is available.
      * @throws SQLNotNumericException if a field expected numeric isn't.
      * @throws SQLNotDateException if a field expected of date kind, isn't.
@@ -135,11 +176,10 @@ public class InputFeatureStream extends
      * @throws SQLInvalidStatementException if the SQL statement is invalid.
      * @throws SQLConnectionClosedException if the connection is closed.
      * @throws SQLUnsupportedParsingFeatureException if a SQL ability is not currently available through this driver.
-     * @throws SQLIllegalColumnIndexException if a column index is illegal.
      * @throws SQLFeatureNotSupportedException if a SQL ability is not currently available through this driver.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
      */
-    public Feature readFeature() throws SQLConnectionClosedException, SQLInvalidStatementException, SQLIllegalParameterException, SQLNoSuchFieldException, SQLUnsupportedParsingFeatureException, SQLNotNumericException, SQLNotDateException, SQLFeatureNotSupportedException, SQLIllegalColumnIndexException, InvalidShapefileFormatException {
+    private Feature internalReadFeature() throws SQLConnectionClosedException, SQLInvalidStatementException, SQLIllegalParameterException, SQLNoSuchFieldException, SQLUnsupportedParsingFeatureException, SQLNotNumericException, SQLNotDateException, SQLFeatureNotSupportedException, InvalidShapefileFormatException {
         try {
             if (endOfFile) {
                 return null;

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidDbaseFileFormatException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidDbaseFileFormatException.java?rev=1678851&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidDbaseFileFormatException.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidDbaseFileFormatException.java Tue May 12 02:58:44 2015
@@ -0,0 +1,32 @@
+package org.apache.sis.storage.shapefile;
+
+import org.apache.sis.storage.DataStoreException;
+
+/**
+ * Thrown when the DBF file format seems to be invalid.
+ * @author Marc LE BIHAN
+ * @version 0.6
+ * @since   0.6
+ * @module
+ */
+public class InvalidDbaseFileFormatException extends DataStoreException {
+    /** Serial ID. */
+    private static final long serialVersionUID = 7152705402305259568L;
+    
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     */
+    public InvalidDbaseFileFormatException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public InvalidDbaseFileFormatException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidShapefileFormatException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidShapefileFormatException.java?rev=1678851&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidShapefileFormatException.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/InvalidShapefileFormatException.java Tue May 12 02:58:44 2015
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.shapefile;
+
+import org.apache.sis.storage.DataStoreException;
+
+/**
+ * Thrown when the Shapefile format seems to be invalid.
+ *
+ * @author  Marc Le Bihan
+ * @version 0.5
+ * @since   0.5
+ * @module
+ */
+public class InvalidShapefileFormatException extends DataStoreException {
+    /** Serial UID. */
+    private static final long serialVersionUID = -2724950178838120005L;
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     */
+    public InvalidShapefileFormatException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public InvalidShapefileFormatException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapeFile.java [UTF-8] Tue May 12 02:58:44 2015
@@ -19,13 +19,6 @@ package org.apache.sis.storage.shapefile
 import java.io.File;
 import java.util.Objects;
 
-import org.apache.sis.internal.shapefile.InvalidShapefileFormatException;
-import org.apache.sis.internal.shapefile.ShapefileNotFoundException;
-import org.apache.sis.internal.shapefile.jdbc.DbaseFileNotFoundException;
-import org.apache.sis.internal.shapefile.jdbc.InvalidDbaseFileFormatException;
-import org.apache.sis.internal.shapefile.jdbc.sql.SQLInvalidStatementException;
-// Branch-dependent imports
-
 /**
  * Provides a ShapeFile Reader.
  *
@@ -62,13 +55,12 @@ public class ShapeFile {
     /**
      * Find features corresponding to an SQL request SELECT * FROM database.
      * @return Features
-     * @throws SQLInvalidStatementException if the SQL statement is invalid.
      * @throws DbaseFileNotFoundException if the database file has not been found.
      * @throws ShapefileNotFoundException if the shapefile has not been found.
      * @throws InvalidDbaseFileFormatException if the database file format is invalid.
      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
      */
-    public InputFeatureStream findAll() throws InvalidDbaseFileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException, SQLInvalidStatementException, InvalidShapefileFormatException {
+    public InputFeatureStream findAll() throws InvalidDbaseFileFormatException, ShapefileNotFoundException, DbaseFileNotFoundException, InvalidShapefileFormatException {
         return new InputFeatureStream(shapeFile, databaseFile);
     }
 }

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapefileNotFoundException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapefileNotFoundException.java?rev=1678851&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapefileNotFoundException.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/ShapefileNotFoundException.java Tue May 12 02:58:44 2015
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage.shapefile;
+
+import org.apache.sis.storage.DataStoreException;
+
+
+/**
+ * Thrown when a shapefile has not been found.
+ *
+ * @author  Marc Le Bihan
+ * @version 0.6
+ * @since   0.6
+ * @module
+ */
+public class ShapefileNotFoundException extends DataStoreException {
+    /** Serial UID. */
+    private static final long serialVersionUID = -6186994116188421967L;
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     */
+    public ShapefileNotFoundException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public ShapefileNotFoundException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties [ISO-8859-1] Tue May 12 02:58:44 2015
@@ -1,3 +1,7 @@
+# Assertion : if this exception is thrown, the involved code that produced it is sure to have a bug.
+#0 : Wrong index returned by findColumn.
+#1 : Field name that caused the wrong calculation. 
+assert.wrong_index_for_column_name=[Erreur interne de l''API] The column index {0}, illegal, has been returned by findColumn for the field ''{1}''.
 
 # Exception : field is not a date. 
 #0 : Field name.

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties [ISO-8859-1] Tue May 12 02:58:44 2015
@@ -1,3 +1,8 @@
+# Assertion : if this exception is thrown, the involved code that produced it is sure to have a bug.
+#0 : Wrong index returned by findColumn.
+#1 : Field name that caused the wrong calculation. 
+assert.wrong_index_for_column_name=[Erreur interne de l''API] L''index de colonne {0}, illégal, a été renvoyé par findColumn pour le champ ''{1}''.
+
 # Exception : field is not a date. 
 #0 : Field name.
 #1 : SQL Query.

Modified: sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java?rev=1678851&r1=1678850&r2=1678851&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/test/java/org/apache/sis/storage/shapefile/ShapeFileTest.java [UTF-8] Tue May 12 02:58:44 2015
@@ -18,9 +18,8 @@ package org.apache.sis.storage.shapefile
 
 import java.io.File;
 import java.net.URISyntaxException;
-import java.sql.SQLException;
 
-import org.apache.sis.internal.shapefile.InvalidShapefileFormatException;
+import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 import org.opengis.feature.Feature;
@@ -48,11 +47,10 @@ public final strictfp class ShapeFileTes
     /**
      * Test polylines count.
      * @throws URISyntaxException if the resource name is incorrect.
-     * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws SQLException if any SQL Exception occuring.
+     * @throws DataStoreException if a general file reading trouble occurs.
      */
     @Test
-    public void testPolyineCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException {
+    public void testPolyineCount() throws URISyntaxException, DataStoreException {
         ShapeFile shp = new ShapeFile(path("SignedBikeRoute_4326_clipped.shp"));
         readAll(shp);
     }
@@ -60,11 +58,10 @@ public final strictfp class ShapeFileTes
     /**
      * Test polygon count.
      * @throws URISyntaxException if the resource name is incorrect.
-     * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws SQLException if any SQL Exception occuring.
+     * @throws DataStoreException if a general file reading trouble occurs.
      */
      @Test
-     public void testPolygonCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException {
+     public void testPolygonCount() throws URISyntaxException, DataStoreException {
         ShapeFile shp = new ShapeFile(path("ANC90Ply_4326.shp"));
         readAll(shp);
     }
@@ -72,11 +69,10 @@ public final strictfp class ShapeFileTes
      /**
       * Test point count.
       * @throws URISyntaxException if the resource name is incorrect.
-      * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-      * @throws SQLException if any SQL Exception occuring.
+      * @throws DataStoreException if a general file reading trouble occurs.
       */
      @Test
-     public void testPointCount() throws URISyntaxException, SQLException, InvalidShapefileFormatException {
+     public void testPointCount() throws URISyntaxException, DataStoreException {
         ShapeFile shp = new ShapeFile(path("ABRALicenseePt_4326_clipped.shp"));
         readAll(shp);
      }
@@ -84,10 +80,9 @@ public final strictfp class ShapeFileTes
     /**
      * Read all the shapefile content.
      * @param shp Shapefile to read.
-     * @throws InvalidShapefileFormatException if the shapefile format is invalid.
-     * @throws SQLException if any SQL Exception occuring.
+     * @throws DataStoreException if a general file reading trouble occurs.
      */
-    private void readAll(ShapeFile shp) throws SQLException, InvalidShapefileFormatException {
+    private void readAll(ShapeFile shp) throws DataStoreException {
         try(InputFeatureStream is = shp.findAll()) {
             Feature feature = is.readFeature();
 

Added: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java?rev=1678851&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java (added)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStoreClosedException.java Tue May 12 02:58:44 2015
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.storage;
+
+import org.apache.sis.storage.DataStoreException;
+
+/**
+ * Thrown when a Data store is closed and can no more return data.
+ *
+ * @author  Marc Le Bihan
+ * @version 0.6
+ * @since   0.6
+ * @module
+ */
+public class DataStoreClosedException extends DataStoreException {
+    /** Serial UID. */
+    private static final long serialVersionUID = 7205119080377665796L;
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     */
+    public DataStoreClosedException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public DataStoreClosedException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}



Mime
View raw message