sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlebi...@apache.org
Subject svn commit: r1643155 [5/6] - in /sis/branches/JDK8: core/sis-utility/src/main/java/org/apache/sis/util/logging/ storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/ storage/sis-shapefile/src/main/java/org/apache/sis/internal/shap...
Date Fri, 05 Dec 2014 05:53:24 GMT
Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/AbstractStatement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/AbstractStatement.java?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/AbstractStatement.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/AbstractStatement.java Fri Dec  5 05:53:23 2014
@@ -0,0 +1,308 @@
+/*
+ * 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.internal.shapefile.jdbc.statement;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.sis.internal.shapefile.jdbc.AbstractJDBC;
+
+
+/**
+ * This base class holds most of the unimplemented feature of a {@code Statement}.
+ * This is used in order to avoid having a Statement implementation of thousand lines and unreadable.
+ *
+ * <table class="sis">
+ *   <caption>Connection default values</caption>
+ *   <tr><th>Property</th>                           <th>Value</th></tr>
+ *   <tr><td>{@link #getResultSetType()}</td>        <td>{@link ResultSet#TYPE_SCROLL_SENSITIVE}</td></tr>
+ *   <tr><td>{@link #getResultSetConcurrency()}</td> <td>{@link ResultSet#CONCUR_READ_ONLY}</td></tr>
+ *   <tr><td>{@link #getResultSetHoldability()}</td> <td>{@link ResultSet#CLOSE_CURSORS_AT_COMMIT}</td></tr>
+ *   <tr><td>{@link #getFetchDirection()}</td>       <td>{@link ResultSet#FETCH_FORWARD}</td></tr>
+ *   <tr><td>{@link #getQueryTimeout()}</td>         <td>0</td></tr>
+ *   <tr><td>{@link #isPoolable()}</td>              <td>{@code false}</td></tr>
+ *   <tr><td>{@link #setPoolable(boolean)}</td>      <td>Ignored</td></tr>
+ *   <tr><td>{@link #getWarnings()}</td>             <td>{@code null}</td></tr>
+ *   <tr><td>{@link #clearWarnings()}</td>           <td>Ignored</td></tr>
+ * </table>
+ *
+ * @author  Marc Le Bihan
+ * @author  Martin Desruisseaux (Geomatys)
+ * @version 0.5
+ * @since   0.5
+ * @module
+ */
+@SuppressWarnings("unused")
+abstract class AbstractStatement extends AbstractJDBC implements Statement {
+    /**
+     * Constructs a new {@code Statement} instance.
+     */
+    AbstractStatement() {
+    }
+
+    /**
+     * Default to {@link ResultSet#TYPE_SCROLL_SENSITIVE}, meaning that a change in the underlying
+     * database may affect the result set.
+     */
+    @Override
+    public int getResultSetType() throws SQLException {
+        return ResultSet.TYPE_SCROLL_SENSITIVE;
+    }
+
+    /**
+     * Default to {@link ResultSet#CONCUR_READ_ONLY}, which is a conservative vale meaning
+     * that the underlying database should not be updated while we iterate in a result set.
+     */
+    @Override
+    public int getResultSetConcurrency() throws SQLException {
+        return ResultSet.CONCUR_READ_ONLY;
+    }
+
+    /**
+     * Defaults to {@link ResultSet#CLOSE_CURSORS_AT_COMMIT}, which seems the most conservative option.
+     */
+    @Override
+    public int getResultSetHoldability() throws SQLException {
+        return ResultSet.CLOSE_CURSORS_AT_COMMIT;
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public int getMaxFieldSize() throws SQLException {
+        throw unsupportedOperation("getMaxFieldSize");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void setMaxFieldSize(int max) throws SQLException {
+        throw unsupportedOperation("setMaxFieldSize");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public int getFetchSize() throws SQLException {
+        throw unsupportedOperation("getFetchSize");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void setFetchSize(int rows) throws SQLException {
+        throw unsupportedOperation("setFetchSize");
+    }
+
+    /**
+     * Defaults to {@link ResultSet#FETCH_FORWARD}.
+     */
+    @Override
+    public int getFetchDirection() throws SQLException {
+        return ResultSet.FETCH_FORWARD;
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void setFetchDirection(int direction) throws SQLException {
+        if (direction != ResultSet.FETCH_FORWARD) {
+            throw unsupportedOperation("setFetchDirection");
+        }
+    }
+
+    /**
+     * Defaults to 0, meaning to limit.
+     */
+    @Override
+    public int getQueryTimeout() throws SQLException {
+        return 0;
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void setQueryTimeout(int seconds) throws SQLException {
+        throw unsupportedOperation("setQueryTimeout");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void setEscapeProcessing(boolean enable) throws SQLException {
+        throw unsupportedOperation("setEscapeProcessing");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void setCursorName(String name) throws SQLException {
+        throw unsupportedOperation("setCursorName");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
+        throw unsupportedOperation("execute with autoGeneratedKeys");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public boolean execute(String sql, int[] columnIndexes) throws SQLException {
+        throw unsupportedOperation("execute with columnIndexes");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public boolean execute(String sql, String[] columnNames) throws SQLException {
+        throw unsupportedOperation("execute with columnNames");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public int executeUpdate(String sql) throws SQLException {
+        throw unsupportedOperation("executeUpdate");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
+        throw unsupportedOperation("executeUpdate");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
+        throw unsupportedOperation("executeUpdate");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public int executeUpdate(String sql, String[] columnNames) throws SQLException {
+        throw unsupportedOperation("executeUpdate");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void addBatch(String sql) throws SQLException {
+        throw unsupportedOperation("addBatch");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void clearBatch() throws SQLException {
+        throw unsupportedOperation("clearBatch");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public int[] executeBatch() throws SQLException {
+        throw unsupportedOperation("executeBatch");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public boolean getMoreResults() throws SQLException {
+        throw unsupportedOperation("getMoreResults");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public boolean getMoreResults(int current) throws SQLException {
+        throw unsupportedOperation("getMoreResults");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public ResultSet getGeneratedKeys() throws SQLException {
+        throw unsupportedOperation("getGeneratedKeys");
+    }
+
+    /**
+     * Defaults to {@code false} since simple statement imlementations are not poolable.
+     */
+    @Override
+    public boolean isPoolable() throws SQLException {
+        return false;
+    }
+
+    /**
+     * Ignored by default since this method is only a hint.
+     */
+    @Override
+    public void setPoolable(boolean poolable) throws SQLException {
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void cancel() throws SQLException {
+        throw unsupportedOperation("cancel");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public void closeOnCompletion() throws SQLException {
+        throw unsupportedOperation("closeOnCompletion");
+    }
+
+    /**
+     * Unsupported by default.
+     */
+    @Override
+    public boolean isCloseOnCompletion() throws SQLException {
+        throw unsupportedOperation("isCloseOnCompletion");
+    }
+}

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.java?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.java Fri Dec  5 05:53:23 2014
@@ -0,0 +1,244 @@
+/*
+ * 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.internal.shapefile.jdbc.statement;
+
+import java.sql.*;
+import java.text.MessageFormat;
+import java.util.HashSet;
+import java.util.Objects;
+import java.util.logging.Level;
+import java.util.stream.Collectors;
+
+import org.apache.sis.internal.shapefile.jdbc.SQLConnectionClosedException;
+import org.apache.sis.internal.shapefile.jdbc.connection.DBFConnection;
+import org.apache.sis.internal.shapefile.jdbc.resultset.AbstractResultSet;
+import org.apache.sis.internal.shapefile.jdbc.resultset.DBFRecordBasedResultSet;
+import org.apache.sis.internal.shapefile.jdbc.sql.SQLInvalidStatementException;
+import org.apache.sis.storage.shapefile.Database;
+
+
+/**
+ * DBF Statement.
+ * @author  Marc Le Bihan
+ * @version 0.5
+ * @since   0.5
+ * @module
+ */
+public class DBFStatement extends AbstractStatement {
+    /** Connection this statement is relying on. */
+    private DBFConnection connection;
+
+    /** ResultSets that are currently opened. */
+    private HashSet<AbstractResultSet> m_openedResultSets = new HashSet<>(); 
+    
+    /** The current result set, or {@code null} if none. */
+    private AbstractResultSet currentResultSet;
+
+    /** Indicates if the statement is currently closed. */
+    private boolean isClosed;
+
+    /**
+     * Constructs a statement.
+     * @param cnt Connection associated to this statement.
+     */
+    public DBFStatement(DBFConnection cnt) {
+        this.connection = cnt;
+    }
+
+    /**
+     * Returns the connection.
+     * @return Connection.
+     * @throws SQLConnectionClosedException if the connection is closed.
+     */
+    @Override
+    public Connection getConnection() throws SQLConnectionClosedException {
+        assertNotClosed();
+        return connection;
+    }
+    
+    /**
+     * @see java.sql.Statement#execute(java.lang.String)
+     */
+    @Override
+    public boolean execute(String sql) throws SQLException {
+        // We are only able to handle SQL Queries at this time.
+        if (sql.trim().toLowerCase().startsWith("select")) {
+            executeQuery(sql);
+            return true; // The result is a ResultSet.
+        }
+        else
+            throw unsupportedOperation("execute something else than a SELECT statement");
+    }
+
+    /**
+     * Executes the given SQL statement.
+     * @return SQL Statement.
+     * @throws SQLConnectionClosedException if the connection is closed.
+     * @throws SQLInvalidStatementException if the SQL Statement is invalid.
+     */
+    @Override
+    public ResultSet executeQuery(final String sql) throws SQLConnectionClosedException, SQLInvalidStatementException {
+        Objects.requireNonNull(sql, "The SQL query cannot be null.");
+        assertNotClosed();
+        
+        DBFRecordBasedResultSet rs = new DBFRecordBasedResultSet(this, sql);
+        registerResultSet(rs);
+        return rs;
+    }
+
+    /**
+     * Returns the JDBC interface implemented by this class.
+     * This is used for formatting error messages.
+     */
+    @Override
+    final protected Class<?> getInterface() {
+        return Statement.class;
+    }
+
+    /**
+     * @see java.sql.Statement#getMaxRows()
+     */
+    @Override
+    public int getMaxRows() {
+        return 0;
+    }
+
+    /**
+     * Returns the result set created by the last call to {@link #executeQuery(String)}.
+     * @return ResultSet.
+     */
+    @Override
+    public ResultSet getResultSet() throws SQLConnectionClosedException {
+        assertNotClosed();
+        return currentResultSet;
+    }
+
+    /**
+     * @see java.sql.Statement#getUpdateCount()
+     */
+    @Override
+    public int getUpdateCount() {
+        return 0; // We currently only handle select statements.
+    }
+
+    /**
+     * @see java.sql.Statement#close()
+     */
+    @Override
+    public void close() {
+        if (isClosed())
+            return;
+        
+        if (currentResultSet != null) {
+            // Inform that this ResultSet could have been closed but that we are handling this :
+            // Some developpers may expect their ResultSet should have been closed before in their program.
+            format(Level.INFO, "log.closing_underlying_resultset", currentResultSet);
+            currentResultSet.close();
+            
+            currentResultSet = null;
+        }
+        
+        // Check if all the underlying ResultSets that has been opened with this statement has been closed.
+        // If not, we log a warning to help the developper.
+        if (m_openedResultSets.size() > 0) {
+            format(Level.WARNING, "log.resultsets_left_opened", m_openedResultSets.size(), m_openedResultSets.stream().map(AbstractResultSet::toString).collect(Collectors.joining(", ")));  
+        }
+        
+        isClosed = true;
+        connection.notifyCloseStatement(this);
+    }
+
+    /**
+     * Returns {@code true} if this statement has been closed or if the underlying connection is closed.
+     * @return true if the database is closed.
+     */
+    @Override
+    public boolean isClosed() {
+        return isClosed || connection.isClosed();
+    }
+    
+    /**
+     * Returns the binary representation of the database.
+     * This function shall not check the closed state of this connection, as it can be used in exception messages descriptions.
+     * @return Database.
+     */
+    public Database getDatabase() {
+        return connection.getDatabase();
+    }
+
+    /**
+     * Asserts that the connection and the statement are together opened.
+     * @throws SQLConnectionClosedException if one of them is closed.
+     */
+    public void assertNotClosed() throws SQLConnectionClosedException {
+        connection.assertNotClosed(); // First, the underlying shall not be closed.
+        
+        // Then, this statement shouldn't be closed too.
+        if (isClosed) {
+            throw new SQLConnectionClosedException(format("excp.closed_statement", connection.getDatabase().getFile().getName()), null, connection.getDatabase().getFile());
+        }
+    }
+    
+    /**
+     * @see java.sql.Wrapper#isWrapperFor(java.lang.Class)
+     */
+    @Override
+    public boolean isWrapperFor(Class<?> iface) {
+        return iface.isAssignableFrom(getInterface());
+    }
+
+    /**
+     * Method called by ResultSet class to notity this statement that a resultSet has been closed.
+     * @param rs ResultSet that has been closed.
+     */
+    public void notifyCloseResultSet(AbstractResultSet rs) {
+        Objects.requireNonNull(rs, "The ResultSet notified being closed cannot be null.");
+        
+        // If this ResultSet was the current ResultSet, now there is no more current ResultSet.
+        if (currentResultSet == rs)
+            currentResultSet = null;
+        
+        if (m_openedResultSets.remove(rs) == false) {
+            throw new RuntimeException(format(Level.SEVERE, "assert.resultset_not_opened_by_me", rs, toString()));
+        }
+    }
+
+    /**
+     * Register a ResultSet as opened.
+     * @param rs Result Set.
+     */
+    public void registerResultSet(AbstractResultSet rs) {
+        currentResultSet = rs;
+        m_openedResultSets.add(rs);
+    }
+
+    /**
+     * @see java.sql.Statement#setMaxRows(int)
+     */
+    @Override
+    public void setMaxRows(int max) {
+        this.logUnsupportedOperation(MessageFormat.format("setMaxRows({0,number})", max));
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    @Override
+    public String toString() {
+        return format("toString", connection != null ? connection.toString() : null, isClosed() == false);
+    }
+}

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/package-info.java?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/package-info.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/jdbc/statement/package-info.java Fri Dec  5 05:53:23 2014
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+
+/** Statements */
+package org.apache.sis.internal.shapefile.jdbc.statement;
\ No newline at end of file

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java?rev=1643155&r1=1643154&r2=1643155&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/Database.java [UTF-8] Fri Dec  5 05:53:23 2014
@@ -17,11 +17,17 @@
 package org.apache.sis.storage.shapefile;
 
 import java.io.*;
-import java.nio.*;
-import java.nio.channels.*;
+import java.nio.ByteOrder;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.charset.Charset;
+import java.nio.charset.UnsupportedCharsetException;
+import java.text.MessageFormat;
 import java.util.*;
+import java.util.logging.Level;
 
-import org.opengis.feature.*;
+import org.apache.sis.util.logging.AbstractAutoChecker;
+import org.opengis.feature.Feature;
 
 /**
  * Load a whole DBF file.
@@ -31,11 +37,12 @@ import org.opengis.feature.*;
  * @version 0.5
  * @module
  *
- * @see <a href="http://ulisse.elettra.trieste.it/services/doc/dbase/DBFstruct.htm" >Database structure</a>
+ * @see <a href="http://ulisse.elettra.trieste.it/services/doc/dbase/DBFstruct.htm" >Database structure - 1</a>
+ * @see <a href="https://www.cs.cmu.edu/~varun/cs315p/xbase.txt">Databse structure - 2</a>
  */
-public class Database implements AutoCloseable {
+public class Database extends AbstractAutoChecker implements AutoCloseable {
     /** Database filename. */
-    private String m_dbfFile;
+    private String dbfFile;
 
     /** Indicates is the database file is closed or not. */
     private boolean isClosed;
@@ -54,12 +61,47 @@ public class Database implements AutoClo
 
     /** Number of bytes in the record. */
     public short DbaseRecordBytes;
-
-    /** Reserved bytes. */
-    public byte[] DbasePlusLanReserved = new byte[13];
+    
+    /** Reserved (dBASE IV) Filled with 00h. */
+    private byte[] reservedFiller1 = new byte[2];
+    
+    /** 
+     * Reserved : Incomplete transaction (dBASE IV).
+     * 00h : Transaction ended (or rolled back).
+     * 01h : Transaction started. 
+     */
+    private byte reservedIncompleteTransaction;
+
+    /**
+     * Reserved : Encryption flag (dBASE IV).
+     * 00h : Not encrypted. 
+     * 01h : Data encrypted.
+     */
+    private byte reservedEncryptionFlag;
+    
+    /** Reserved : Free record thread (for LAN only). */
+    private byte[] reservedFreeRecordThread = new byte[4];
+    
+    /** Reserved : For multi-user (DBase 3+). */
+    private byte[] reservedMultiUser = new byte[8];
+
+    /** Reserved : MDX flag (dBASE IV). */
+    private byte reservedMDXFlag;
+    
+    /** Binary code page value. */
+    private byte codePage;
+    
+    /** Database charset. */
+    private Charset charset;
+    
+    /** Reserved (dBASE IV) Filled with 00h. */
+    private byte[] reservedFiller2 = new byte[2];
+    
+    /** Marks the end of the descriptor : must be 0x0D. */
+    private byte descriptorTerminator;
 
     /** Fields descriptor. */
-    public ArrayList<FieldDescriptor> fieldsDescriptors = new ArrayList<>();
+    public FieldsDescriptors fieldsDescriptors = new FieldsDescriptors();
 
     /** Input Stream on the DBF. */
     private FileInputStream fis;
@@ -72,23 +114,34 @@ public class Database implements AutoClo
 
     /** Current row rumber. */
     private int rowNum;
-
+    
     /**
      * Load a database file.
-     * @param dbfFile Database file.
+     * @param file Database file.
      * @throws FileNotFoundException if the database file cannot be found.
+     * @throws InvalidDbaseFileFormatException if the database seems to be invalid.
      */
-    public Database(String dbfFile) throws FileNotFoundException {
-        Objects.requireNonNull(dbfFile, "The database file to load cannot be null.");
-        m_dbfFile = dbfFile;
+    public Database(String file) throws FileNotFoundException, InvalidDbaseFileFormatException {
+        Objects.requireNonNull(file, "The database file to load cannot be null.");
+        dbfFile = file;
 
-        fis = new FileInputStream(m_dbfFile);
+        fis = new FileInputStream(file);
         fc = fis.getChannel();
         rowNum = 0;
         isClosed = false;
+        
+        loadDescriptor();
     }
 
     /**
+     * Returns the database charset, converted from its internal code page.
+     * @return Charset.
+     */
+    public Charset getCharset() {
+        return this.charset;
+    }
+    
+    /**
      * Return the record count of the database file.
      * @return Record count.
      */
@@ -114,29 +167,56 @@ public class Database implements AutoClo
 
     /**
      * Loading the database file content from binary .dbf file.
-     * @throws IOException if the file cannot be opened.
+     * @throws InvalidDbaseFileFormatException if descriptor is not readable. 
      */
-    public void loadDescriptor() throws IOException {
-        int fsize = (int) fc.size();
-        df = fc.map(FileChannel.MapMode.READ_ONLY, 0, fsize);
-
-        this.DbaseVersion = df.get();
-        df.get(this.DbaseLastUpdate);
-
-        df.order(ByteOrder.LITTLE_ENDIAN);
-        this.recordCount = df.getInt();
-        this.DbaseHeaderBytes = df.getShort();
-        this.DbaseRecordBytes = df.getShort();
-        df.order(ByteOrder.BIG_ENDIAN);
-        df.getShort(); // reserved
-        df.get(); // reserved
-        df.get(DbasePlusLanReserved);
-        df.getInt();
-
-        while (df.position() < this.DbaseHeaderBytes - 1) {
-            FieldDescriptor fd = toFieldDescriptor();
-            this.fieldsDescriptors.add(fd);
-            // loop until you hit the 0Dh field terminator
+    private void loadDescriptor() throws InvalidDbaseFileFormatException {
+        try {
+            int fsize = (int) fc.size();
+            df = fc.map(FileChannel.MapMode.READ_ONLY, 0, fsize);
+    
+            this.DbaseVersion = df.get();
+            df.get(this.DbaseLastUpdate);
+    
+            df.order(ByteOrder.LITTLE_ENDIAN);
+            this.recordCount = df.getInt();
+            this.DbaseHeaderBytes = df.getShort();
+            this.DbaseRecordBytes = df.getShort();
+            df.order(ByteOrder.BIG_ENDIAN);
+            
+            df.get(reservedFiller1);
+            this.reservedIncompleteTransaction = df.get();
+            this.reservedEncryptionFlag = df.get();
+            df.get(reservedFreeRecordThread);
+            df.get(reservedMultiUser);
+            reservedMDXFlag = df.get();
+            
+            // Translate code page value to a known charset.
+            this.codePage = df.get();
+            this.charset = toCharset(this.codePage);             
+            
+            df.get(reservedFiller2); 
+    
+            while(df.position() < this.DbaseHeaderBytes - 1) {
+                FieldDescriptor fd = toFieldDescriptor();
+                this.fieldsDescriptors.add(fd);
+                // loop until you hit the 0Dh field terminator
+            }
+            
+            this.descriptorTerminator = df.get();
+
+            // 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.SEVERE, "excp.filedescriptor_problem", new File(dbfFile).getAbsolutePath(), "Character marking the end of the fields descriptors (0x0D) has not been found.");
+                throw new InvalidDbaseFileFormatException(message);
+            }
+        }
+        catch(IOException e) {
+            // This exception doesn't denote a trouble of file opening because the file has been checked before 
+            // the calling of this private function.
+            // 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.SEVERE, "excp.filedescriptor_problem", new File(dbfFile).getAbsolutePath(), e.getMessage());
+            throw new InvalidDbaseFileFormatException(message);
         }
     }
 
@@ -146,7 +226,7 @@ public class Database implements AutoClo
      */
     public HashMap<String, Object> readNextRowAsObjects() {
         // TODO: ignore deleted records
-        df.get(); // denotes whether deleted or current
+        byte isDeleted = df.get(); // denotes whether deleted or current
         // read first part of record
 
         HashMap<String, Object> fieldsValues = new HashMap<>();
@@ -241,7 +321,7 @@ public class Database implements AutoClo
         byte[] data = new byte[6];
         df.get(data); // reserved
 
-        return (fd);
+        return fd;
     }
 
     /**
@@ -265,22 +345,171 @@ public class Database implements AutoClo
     public boolean isClosed() {
         return isClosed;
     }
+    
+    /**
+
+     * Return a date from a byte array.
+     * @param yymmdd byte[3] with byte[0] = year (2 digits), [1] = month, [2] = day. 
+     * @return Date.
+     */
+    private Date toDate(byte[] yymmdd) {
+        Objects.requireNonNull(yymmdd, "the yymmdd bytes cannot be null");
+        
+        if (yymmdd.length != 3)
+            throw new IllegalArgumentException(MessageFormat.format("Database:toDate() works only on a 3 bytes YY MM DD date. this array has {0} length", yymmdd.length));
+        
+        Objects.requireNonNull(yymmdd[0], "the year byte cannot be null");
+        Objects.requireNonNull(yymmdd[1], "the month byte cannot be null");
+        Objects.requireNonNull(yymmdd[2], "the day byte cannot be null");
+        
+        int year = yymmdd[0] < 70 ? 100 + yymmdd[0] : yymmdd[0];
+        int month = yymmdd[1];
+        int day = yymmdd[2];
+        
+        @SuppressWarnings("deprecation") // But everything is deprecated in DBF files... 
+        Date date = new Date(year, month, day);
+        return date;
+    }
 
     /**
+     * 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
+     * file might be corrupted.
+     * @throws UnsupportedCharsetException if the code page as no representation in recents Charset (legacy DOS or macintosh charsets).
+     */
+    private Charset toCharset(byte codePageBinaryValue) throws InvalidDbaseFileFormatException, UnsupportedCharsetException {
+        // Attempt to find a known conversion.
+        String dbfCodePage = toCodePage(codePageBinaryValue);
+        
+        // If no conversion has been found, decide if the cause is an unsupported value or an illegal value to choose the good exception to return.
+        if (dbfCodePage == null) {
+            switch(Byte.toUnsignedInt(codePageBinaryValue)) {
+                case 0x04: dbfCodePage = "unsupported"; break;
+                case 0x68: dbfCodePage = "unsupported"; break; // Kamenicky (Czech) MS-DOS
+                case 0x69: dbfCodePage = "unsupported"; break; // Mazovia (Polish) MS-DOS
+                case 0x96: dbfCodePage = "unsupported"; break; // russian mac
+                case 0x97: dbfCodePage = "unsupported"; break; // eastern european macintosh
+                case 0x98: dbfCodePage = "unsupported"; break; // greek macintosh
+                case 0xC8: dbfCodePage = "unsupported"; break; // windows ee
+                default: dbfCodePage = "invalid"; break;
+            }
+        }
+        
+        assert dbfCodePage != null;
+        
+        // If the code page is invalid, the database itself has chances to be invalid too.
+        if (dbfCodePage.equals("invalid")) {
+            String message = format(Level.SEVERE, "excp.illegal_codepage", codePageBinaryValue, new File(dbfFile).getAbsolutePath());
+            throw new InvalidDbaseFileFormatException(message);
+        }
+        
+        // If the code page cannot find a match for a more recent Charset, we wont be able to handle this DBF.
+        if (dbfCodePage.equals("unsupported")) {
+            String message = format(Level.SEVERE, "excp.unsupported_codepage", dbfCodePage, new File(dbfFile).getAbsolutePath());
+            throw new UnsupportedCharsetException(message);
+        }
+        
+        try {
+            return Charset.forName(dbfCodePage);
+        }
+        catch(IllegalArgumentException e) {
+            // If this happens here, it means that we have selected a wrong charset. We have a bug.
+            String message = format(Level.SEVERE, "assert.wrong_charset_selection", dbfCodePage, new File(dbfFile).getAbsolutePath());
+            throw new RuntimeException(message);
+        }
+    }
+
+    /**
+     * Return a Charset code page from a binary code page value.
+     * @param pageCodeBinaryValue binary code page value.
+     * @return Page code.
+     */
+    private String toCodePage(byte pageCodeBinaryValue) {
+        // From http://trac.osgeo.org/gdal/ticket/2864
+        HashMap<Integer, String> knownConversions = new HashMap<>();
+        knownConversions.put(0x01, "cp437"); //  U.S. MS–DOS
+        knownConversions.put(0x02, "cp850"); // International MS–DOS
+        knownConversions.put(0x03, "cp1252"); // Windows ANSI
+        knownConversions.put(0x08, "cp865"); //  Danish OEM
+        knownConversions.put(0x09, "cp437"); //  Dutch OEM
+        knownConversions.put(0x0a, "cp850"); //  Dutch OEM*
+        knownConversions.put(0x0b, "cp437"); //  Finnish OEM
+        knownConversions.put(0x0d, "cp437"); //  French OEM
+        knownConversions.put(0x0e, "cp850"); //  French OEM*
+        knownConversions.put(0x0f, "cp437"); //  German OEM
+        knownConversions.put(0x10, "cp850"); //  German OEM*
+        knownConversions.put(0x11, "cp437"); //  Italian OEM
+        knownConversions.put(0x12, "cp850"); //  Italian OEM*
+        knownConversions.put(0x13, "cp932"); //  Japanese Shift-JIS
+        knownConversions.put(0x14, "cp850"); //  Spanish OEM*
+        knownConversions.put(0x15, "cp437"); //  Swedish OEM
+        knownConversions.put(0x16, "cp850"); //  Swedish OEM*
+        knownConversions.put(0x17, "cp865"); //  Norwegian OEM
+        knownConversions.put(0x18, "cp437"); //  Spanish OEM
+        knownConversions.put(0x19, "cp437"); //  English OEM (Britain)
+        knownConversions.put(0x1a, "cp850"); //  English OEM (Britain)*
+        knownConversions.put(0x1b, "cp437"); //  English OEM (U.S.)
+        knownConversions.put(0x1c, "cp863"); //  French OEM (Canada)
+        knownConversions.put(0x1d, "cp850"); //  French OEM*
+        knownConversions.put(0x1f, "cp852"); //  Czech OEM
+        knownConversions.put(0x22, "cp852"); //  Hungarian OEM
+        knownConversions.put(0x23, "cp852"); //  Polish OEM
+        knownConversions.put(0x24, "cp860"); //  Portuguese OEM
+        knownConversions.put(0x25, "cp850"); //  Portuguese OEM*
+        knownConversions.put(0x26, "cp866"); //  Russian OEM
+        knownConversions.put(0x37, "cp850"); //  English OEM (U.S.)*
+        knownConversions.put(0x40, "cp852"); //  Romanian OEM
+        knownConversions.put(0x4d, "cp936"); //  Chinese GBK (PRC)
+        knownConversions.put(0x4e, "cp949"); //  Korean (ANSI/OEM)
+        knownConversions.put(0x4f, "cp950"); //  Chinese Big5 (Taiwan)
+        knownConversions.put(0x50, "cp874"); //  Thai (ANSI/OEM)
+        knownConversions.put(0x57, "cp1252"); // ANSI
+        knownConversions.put(0x58, "cp1252"); // Western European ANSI
+        knownConversions.put(0x59, "cp1252"); // Spanish ANSI
+        knownConversions.put(0x64, "cp852"); //  Eastern European MS–DOS
+        knownConversions.put(0x65, "cp866"); //  Russian MS–DOS
+        knownConversions.put(0x66, "cp865"); //  Nordic MS–DOS
+        knownConversions.put(0x67, "cp861"); //  Icelandic MS–DOS
+        knownConversions.put(0x6a, "cp737"); //  Greek MS–DOS (437G)
+        knownConversions.put(0x6b, "cp857"); //  Turkish MS–DOS
+        knownConversions.put(0x6c, "cp863"); //  French–Canadian MS–DOS
+        knownConversions.put(0x78, "cp950"); //  Taiwan Big 5
+        knownConversions.put(0x79, "cp949"); //  Hangul (Wansung)
+        knownConversions.put(0x7a, "cp936"); //  PRC GBK
+        knownConversions.put(0x7b, "cp932"); //  Japanese Shift-JIS
+        knownConversions.put(0x7c, "cp874"); //  Thai Windows/MS–DOS
+        knownConversions.put(0x86, "cp737"); //  Greek OEM
+        knownConversions.put(0x87, "cp852"); //  Slovenian OEM
+        knownConversions.put(0x88, "cp857"); //  Turkish OEM
+        knownConversions.put(0xc8, "cp1250"); // Eastern European Windows
+        knownConversions.put(0xc9, "cp1251"); // Russian Windows
+        knownConversions.put(0xca, "cp1254"); // Turkish Windows
+        knownConversions.put(0xcb, "cp1253"); // Greek Windows
+        knownConversions.put(0xcc, "cp1257"); // Baltic Windows
+        
+        return(knownConversions.get(Byte.toUnsignedInt(pageCodeBinaryValue)));
+    }
+
+    /**
+     * Return the database as a {@link java.io.File}.
+     * @return File.
+     */
+    public File getFile() {
+        return(new File(dbfFile));
+    }
+    
+    /**
      * @see java.lang.Object#toString()
      */
     @Override
     public String toString() {
-        StringBuilder s = new StringBuilder();
-        String lineSeparator = System.getProperty("line.separator", "\n");
-
-        s.append("DbaseVersion: ").append(DbaseVersion).append(lineSeparator);
-        s.append("DbaseLastUpdate: ").append(new String(DbaseLastUpdate)).append(lineSeparator);
-        s.append("FeatureCount: ").append(recordCount).append(lineSeparator);
-        s.append("DbaseHeaderBytes: ").append(DbaseHeaderBytes).append(lineSeparator);
-        s.append("DbaseRecordBytes: ").append(DbaseRecordBytes).append(lineSeparator);
+        return format("toString", System.getProperty("line.separator", "\n"),
+               DbaseVersion, toDate(DbaseLastUpdate), recordCount, fieldsDescriptors, DbaseHeaderBytes, DbaseRecordBytes, charset);
+        
+        /*StringBuilder s = new StringBuilder();
         s.append("DbasePlusLanReserved: ").append(DbasePlusLanReserved).append(lineSeparator);
-
-        return s.toString();
+        */
     }
 }

Modified: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldDescriptor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldDescriptor.java?rev=1643155&r1=1643154&r2=1643155&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldDescriptor.java [UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldDescriptor.java [UTF-8] Fri Dec  5 05:53:23 2014
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.storage.shapefile;
 
+import org.apache.sis.util.logging.AbstractAutoChecker;
+
 
 /**
  * Field descriptor.
@@ -25,13 +27,14 @@ package org.apache.sis.storage.shapefile
  * @version 0.5
  * @module
  */
-public class FieldDescriptor {
+public class FieldDescriptor extends AbstractAutoChecker {
     /** Field name. */
     public byte[] FieldName = new byte[11];
 
     /** Field type. */
     public DataType FieldType;
 
+    /** Field address (Field data address (address is set in memory; not useful on disk). */
     public byte[] FieldAddress = new byte[4];
 
     /** Field length. */
@@ -50,6 +53,22 @@ public class FieldDescriptor {
     public byte[] DbasePlusLanReserved3 = new byte[2];
 
     public byte SetFields;
+    
+    /**
+     * Returns the decimal count of that field.
+     * @return Decimal count.
+     */
+    public int getDecimalCount() {
+        return Byte.toUnsignedInt(this.FieldDecimalCount);
+    }
+    
+    /**
+     * Returns the field length.
+     * @return field length.
+     */
+    public int getLength() {
+        return Byte.toUnsignedInt(this.FieldLength);
+    }
 
     /**
      * Return the field name.
@@ -64,32 +83,24 @@ public class FieldDescriptor {
     }
 
     /**
-     * Return the field length.
-     * @return field length.
+     * Return the field data type.
+     * @return Data type.
      */
-    public int getLength() {
-        return Byte.toUnsignedInt(this.FieldLength);
+    public DataType getType() {
+        return(FieldType);
     }
-
+    
     /**
      * @see java.lang.Object#toString()
      */
     @Override
     public String toString() {
-
-        StringBuilder s = new StringBuilder();
-        String lineSeparator = System.getProperty("line.separator", "\n");
-
-        s.append("FieldName : ").append(new String(FieldName)).append(lineSeparator);
-        s.append("FieldType : ").append(FieldType).append(lineSeparator);
-        s.append("FieldAddress :").append(FieldAddress).append(lineSeparator);
-        s.append("FieldLength : ").append(FieldLength).append(lineSeparator);
-        s.append("FieldDecimalCount: ").append(FieldDecimalCount).append(lineSeparator);
-        s.append("DbasePlusLanReserved2: ").append(DbasePlusLanReserved2 + "\n");
-        s.append("WorkAreaID: ").append(WorkAreaID).append(lineSeparator);
-        s.append("DbasePlusLanReserved3: ").append(DbasePlusLanReserved3).append(lineSeparator);
-        s.append("SetFields: ").append(SetFields).append(lineSeparator);
-
-        return s.toString();
+        String text = format("toString", getName(), FieldType, FieldLength, FieldDecimalCount);
+        return text;
+        
+        // s.append("DbasePlusLanReserved2: ").append(DbasePlusLanReserved2 + "\n");
+        // s.append("WorkAreaID: ").append(WorkAreaID).append(lineSeparator);
+        // s.append("DbasePlusLanReserved3: ").append(DbasePlusLanReserved3).append(lineSeparator);
+        // s.append("SetFields: ").append(SetFields).append(lineSeparator);
     }
 }

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldsDescriptors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldsDescriptors.java?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldsDescriptors.java (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/java/org/apache/sis/storage/shapefile/FieldsDescriptors.java Fri Dec  5 05:53:23 2014
@@ -0,0 +1,41 @@
+/*
+ * 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 java.util.stream.Collectors;
+
+import org.apache.sis.util.logging.AbstractAutoCheckerList;
+
+/**
+ * Fields descriptors of a DBase 3 field.
+ * @author Marc LE BIHAN
+ */
+public class FieldsDescriptors extends AbstractAutoCheckerList<FieldDescriptor> {
+    /** Serial ID. */
+    private static final long serialVersionUID = 4313603786088155463L;
+
+    /**
+     * @see java.util.AbstractCollection#toString()
+     */
+    @Override 
+    public String toString() {
+        String lineSeparator = System.getProperty("line.separator", "\n");
+        
+        String text = stream().map(FieldDescriptor::toString).collect(Collectors.joining(lineSeparator, "{" + lineSeparator, "}" + lineSeparator));
+        return text;
+    }
+}

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=1643155&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 Fri Dec  5 05:53:23 2014
@@ -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 java.sql.SQLNonTransientException;
+
+
+/**
+ * Thrown when the DBF file format seems to be invalid.
+ *
+ * @author  Marc Le Bihan
+ * @version 0.5
+ * @since   0.5
+ * @module
+ */
+public class InvalidDbaseFileFormatException extends SQLNonTransientException {
+    /** Serial UID. */
+    private static final long serialVersionUID = 3924612615300490837L;
+
+    /**
+     * 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);
+    }
+}

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=1643155&r1=1643154&r2=1643155&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] Fri Dec  5 05:53:23 2014
@@ -107,40 +107,47 @@ public class ShapeFile {
         StringBuilder b = new StringBuilder(shpfile);
         b.replace(shpfile.length() - 3, shpfile.length(), "dbf");
 
-        dbf = new Database(b.toString());
-
-        try (FileInputStream fis = new FileInputStream(shpfile); FileChannel fc = fis.getChannel();) {
-            int fsize = (int) fc.size();
-            MappedByteBuffer rf = fc.map(FileChannel.MapMode.READ_ONLY, 0, fsize);
-
-            this.FileCode = rf.getInt();
-            rf.getInt();
-            rf.getInt();
-            rf.getInt();
-            rf.getInt();
-            rf.getInt();
-            this.FileLength = rf.getInt() * 2;
-
-            rf.order(ByteOrder.LITTLE_ENDIAN);
-            this.Version = rf.getInt();
-            this.ShapeType = ShapeTypeEnum.get(rf.getInt());
-            this.xmin = rf.getDouble();
-            this.ymin = rf.getDouble();
-            this.xmax = rf.getDouble();
-            this.ymax = rf.getDouble();
-            this.zmin = rf.getDouble();
-            this.zmax = rf.getDouble();
-            this.mmin = rf.getDouble();
-            this.mmax = rf.getDouble();
-            rf.order(ByteOrder.BIG_ENDIAN);
-
-            dbf.loadDescriptor();
-            final DefaultFeatureType featureType = getFeatureType(shpfile);
-
-            dbf.getByteBuffer().get(); // should be 0d for field terminator
-            loadFeatures(featureType, rf);
-        } finally {
-            dbf.close();
+        try {
+            dbf = new Database(b.toString());
+    
+            try(FileInputStream fis = new FileInputStream(shpfile); FileChannel fc = fis.getChannel();) {
+                int fsize = (int) fc.size();
+                MappedByteBuffer rf = fc.map(FileChannel.MapMode.READ_ONLY, 0, fsize);
+    
+                this.FileCode = rf.getInt();
+                rf.getInt();
+                rf.getInt();
+                rf.getInt();
+                rf.getInt();
+                rf.getInt();
+                this.FileLength = rf.getInt() * 2;
+    
+                rf.order(ByteOrder.LITTLE_ENDIAN);
+                this.Version = rf.getInt();
+                this.ShapeType = ShapeTypeEnum.get(rf.getInt());
+                this.xmin = rf.getDouble();
+                this.ymin = rf.getDouble();
+                this.xmax = rf.getDouble();
+                this.ymax = rf.getDouble();
+                this.zmin = rf.getDouble();
+                this.zmax = rf.getDouble();
+                this.mmin = rf.getDouble();
+                this.mmax = rf.getDouble();
+                rf.order(ByteOrder.BIG_ENDIAN);
+    
+                final DefaultFeatureType featureType = getFeatureType(shpfile);
+    
+                //dbf.getByteBuffer().get(); // should be 0d for field terminator
+                loadFeatures(featureType, rf);
+            } 
+            finally {
+                dbf.close();
+            }
+        }
+        catch(InvalidDbaseFileFormatException e) {
+            // Eventually, gather this low level trouble in a more generic exception, to avoid caller to catch hundred of different technical exceptions :
+            // at this level, we won't attempt to resolve or find a work around to the problems the DBF had.
+            throw new DataStoreException(e.getMessage(), e);
         }
     }
 

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/AbstractJDBC.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/AbstractJDBC.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/AbstractJDBC.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/AbstractJDBC.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,23 @@
+# Exception thrown when the driver cannot handle a feature.
+#0: Interface that is not implemented.
+#1: Method name (or goal / feature asked for).
+#2: Simple class name.
+excp.unsupportedDriverFeature=Internal JDBC driver currently does not support the {0} ability/calls in the {2}.{1}() method.
+
+# Exception thrown when the driver cannot handle a feature.
+#0: Interface that is not implemented.
+#1: Method name (or goal / feature asked for).
+#2: Simple class name.
+#3: Method arguments.
+excp.unsupportedDriverFeature_with_arguments=Internal JDBC driver currently does not support the {0} ability/calls in the {2}.{1}({3}) method.
+
+# Log a function call without arguments.
+#0: Method name (or goal / feature asked for).
+#1: Simple class name.
+log.step=[DBase 3 Driver] {1}.{0}()...
+
+# Log a function call with arguments.
+#0: Method name (or goal / feature asked for).
+#1: Simple class name.
+#2: Method arguments.
+log.step_with_arguments=[DBase 3 Driver] {1}.{0}({2})...

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/AbstractJDBC_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/AbstractJDBC_fr.properties?rev=1643155&view=auto
==============================================================================
    (empty)

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,6 @@
+# The auto commit has no effect.
+#0: true / false.
+log.auto_commit_ignored=The auto-commit \u2018{0}\u2019 value is currently ignored (not implemented): auto-commit is always true.
+
+# Log to warn that the rollback has no effect.
+log.commit_rollback_ignored=Commit and rollback has no effect (currently not implemented): auto-commit is always true.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection_fr.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/AbstractConnection_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,6 @@
+# Exception thrown if th auto commit has no effect.
+#0: true / false.
+log.auto_commit_ignored=L\u2019auto-commit \u2018{0}\u2019 est actuellement ignor\u00e9 (non impl\u00e9ment\u00e9)\u202f: L\u2019auto-commit vaut toujours \u2018vrai\u2019.
+
+# Log to warn that the rollback has no effect. 
+log.commit_rollback_ignored=Les commit et rollback n'ont pas d\u2019effet (ils ne sont pas actuellement impl\u00e9ment\u00e9s)\u202f: l\u2019auto-commit vaut toujours \u2018vrai\u2019.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,38 @@
+# Asserttion : the statement has not been found opened by this connection when it was searched for.
+#0 : the statement that should had been found opened by this connection.
+#1 : The connection.
+assert.statement_not_opened_by_me=[Internal API trouble] The Statement {0} has not been opened by the connection {1}.  
+
+# Exception thrown if the connection is closed 
+#0 : DBF File name.
+excp.closed_connection=The connection to the DBase 3 file {0} is closed.
+
+# Exception : a directory has been given instead of a file.
+#0 : Directory name.
+excp.directory_not_expected=Your file ''{0}'' points to a directory instead of a file. 
+
+# Exception : the file has not been found.
+#0 : File that has not been found.
+excp.file_not_found=The DBF file ''{0}'' has not been found.
+
+# Warning : autocommit isn't implemented.
+#0 : true / false.
+log.autocommit_ignored=The autocommit {0} is currently ignored (not implemented) : autocommit is always true.
+
+# Warning : commit and rollback are not implemented : autocommit is always true.
+log.commit_rollback_ignored=Commit and rollback has no effect (currently not implemented) : autocommit is always true.
+
+# Information : Connection opened.
+#0 : DBF File opened.
+#1 : Header information.
+log.database_connection_opened=Database connection to {0} opened. DBase 3 descriptor of this dbf file is : {1}.
+
+# Warning : At the time the caller is closing this connection, he has left some statements opened.
+#0, number : Number of statements that are left opened.
+#1 : Opened statements.
+log.statements_left_opened={0,number,integer} {0,choice,1#statement is|2#statements are} left opened at the time you are closing this connection : {1}.
+
+# toString()
+#0 : Database file.
+#1 : Open state (true, false).
+toString='{'{0}, connection open state : {1}'}'

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection_fr.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/connection/DBFConnection_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,28 @@
+# Exception thrown if the connection is closed 
+#0: DBF File name.
+excp.closed_connection=La connexion à {0} est fermée.
+
+# Exception : a directory has been given instead of a file.
+#0 : Directory name.
+excp.directory_not_expected=Votre fichier ''{0}'' désigne un répertoire et non un fichier. 
+
+# Exception : the file has not been found.
+#0 : File that has not been found.
+excp.file_not_found=Le fichier DBF ''{0}'' n''a pas été trouvé.
+
+# Warning : autocommit isn't implemented.
+#0 : true / false.
+log.autocommit_ignored=L''autocommit {0} est actuellement ignoré (non implémenté) : L''autocommit vaut toujours true.
+
+# Warning : commit and rollback are not implemented : autocommit is always true.
+log.commit_rollback_ignored=Les commit et rollback n'ont pas d''effet (ils ne sont pas actuellement implémentés) : l''autocommit vaut toujours true.
+
+# Warning : At the time the caller is closing this connection, he has left some statements opened.
+#0, number : Number of statements that are left opened.
+#1 : Opened statements.
+log.statements_left_opened={0,number,integer} {0,choice,1#statement est resté ouvert|2#statements sont restés ouverts} au moment où vous fermez cette connexion : {1}.
+
+# Information : Connection opened.
+#0 : DBF File opened.
+#1 : Header information.
+log.database_connection_opened=Connexion à la base de données {0} ouverte. Le descripteur DBase 3 de ce fichier dbf est : {1}.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,4 @@
+# Exception : illegal column index for metadata querying.
+#0 : The index that is illegal.
+#1, number : The number of column in that ResultSet.
+excp.illegal_column_index_metadata=Illegal column index {0} for metadata. The query returned a ResultSet with {1,number} columns.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData_fr.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/metadata/DBFResultSetMataData_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,4 @@
+# Exception : illegal column index for metadata querying.
+#0 : The index that is illegal.
+#1, number : The number of column in that ResultSet.
+excp.illegal_column_index_metadata=Index de colonne {0} illégal pour des meta-données. La requête a retourné un ResultSet avec {1,number} colonnes.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,21 @@
+# Exception : attempting to get a connection from a closed connection.
+#0 : SQL Query that can no more be queryied.
+#1 : Database name.
+excp.closed_resultset=The ResultSet connection is closed, and querying data for SQL request ''{0}'' on database {1} is no longer possible.
+
+# Exception : illegal column index.
+#0 : The index that is illegal.
+#1, number : The number of column in that ResultSet.
+excp.illegal_column_index=Illegal column index {0}. The query returned a ResultSet with {1,number} columns.
+
+# Exception thrown when a column doesn't exist in the result set.
+#0 : Column name.
+#1 : SQL Query that was attempted but failed.
+#2 : Database name.
+excp.no_such_column_in_resultset=There is no ''{0}'' column in this SQL query ''{1}'' on database {2}.
+
+# toString()
+#0 : Underlying statement.
+#1 : SQL Query.
+#2 : Open state.
+toString='{'(based on statement : {0}), sql query : {1}, result set open state : {2}'}'

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet_fr.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractResultSet_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,15 @@
+# Exception : attempting to get a connection from a closed connection.
+#0: SQL Query that can no more be queryied.
+#1: Database name.
+excp.closed_resultset=Le ResultSet est fermé, et requêter des données pour la requête SQL ''{0}'' sur la base de données {1} n''est plus possible. 
+
+# Exception : illegal column index.
+#0 : The index that is illegal.
+#1, number : The number of column in that ResultSet.
+excp.illegal_column_index=Index de colonne {0} illégal. La requête a renvoyé un ResultSet avec {1,number} colonnes.
+
+# Exception thrown when a column doesn't exist in the result set.
+#0: Column name.
+#1: SQL Query that was attempted but failed.
+#2: Database name.
+excp.no_such_column_in_resultset=Il n''y a pas de colonne ''{0}'' dans cette requête SQL ''{1}'' sur la base de données {2}.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet.properties?rev=1643155&view=auto
==============================================================================
    (empty)

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/AbstractUnimplementedFeaturesOfResultSet_fr.properties?rev=1643155&view=auto
==============================================================================
    (empty)

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFBuiltInMemoryResultSetForTablesListing.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,5 @@
+# The ResultSet listing the tables has only one result.
+excp.only_one_table_per_dbf=DBase 3 files contain only one table.
+
+# The ResultSet listing the tables types has only one result.
+excp.only_one_table_type_handled=DBase 3 only handles TABLE types. No more results available.

Added: 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=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,24 @@
+
+# Exception : field is not a date. 
+#0 : Field name.
+#1 : SQL Query.
+#2 : Field value that is not a date.
+excp.field_is_not_a_date=The field {0} in the query ''{1}'' has a ''{2}'' value that is not a date. 
+
+# Exception : field is not numeric. 
+#0 : Field name.
+#1 : Field type.
+#2 : SQL Query.
+#3 : Field value that is not a number.
+excp.field_is_not_numeric=The field {0} of type {1} in the query ''{2}'' has a ''{3}'' value that is not numeric. 
+
+# Exception thrown when the resultset has no more results.
+#0 : SQL Query that was attempted but failed.
+#1 : Database name.
+excp.no_more_results=The result set has no more results for the SQL request ''{0}'' on database {1}.
+
+# Log : a string value has been converted with a charset.
+#0 : Field name.
+#1 : Field original database value.
+#2 : Field value after being converted with the charset.
+log.string_field_charset=String field name ''{0}'', value ''{1}'' changed to ''{2}'' using charset {3}.

Added: 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=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/resultset/DBFRecordBasedResultSet_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,24 @@
+# Exception : field is not a date. 
+#0 : Field name.
+#1 : SQL Query.
+#2 : Field value that is not a date.
+excp.field_is_not_a_date=Le champ {0} dans la requête ''{1}'' a une valeur ''{2}'' qui n''est pas une date.  
+
+# Exception : field is not numeric. 
+#0 : Field name.
+#1 : Field type.
+#2 : SQL Query.
+#3 : Field value that is not a number.
+excp.field_is_not_numeric=Le champ {0} de type {1} dans la requête ''{2}'' a une valeur ''{3}'' qui n''est pas numérique. 
+
+# Exception : the result set has no more results.
+#0: SQL Query that was attempted but failed.
+#1: Database name.
+excp.no_more_results=Le ResultSet n''a plus de résultats pour la requête SQL ''{0}'' sur la base de données {1}.
+
+# Log : a string value has been converted with a charset.
+#0 : Field name.
+#1 : Field original database value.
+#2 : Field value after being converted with the charset.
+log.string_field_charset=String field name ''{0}'', value ''{1}'' changed to ''{2}'' using charset {3}.
+

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,25 @@
+# A field type is not known.
+#0 : Field type.
+assert.unknown_field_type=[Internal API Error] The field type {0} is not known among the DBase 3 type.
+
+# Illegal parameter in a where clause.
+#0 : Illegal parameter value.
+#1 : SQL Query that failed.
+excp.illegal_parameter_where=The where clause contains a parameter that has an illegal value : {0}. The query that failed is : {1}.
+
+# An operator in a statement is invalid.
+#0 : Invalid operator.
+#1 : SQL Query that failed.
+excp.invalid_statement_operator=The operator {0} in the where clause of the SQL Query {1} is invalid.
+
+# A type encountered while translating literals and fields value to java types is not Comparable.
+#0 : Value.
+#1 : Java type.
+#2 : SQL Query.
+excp.uncomparable_type=The field or literal value {0} belongs to a Java type {1} that is not Comparable, and this driver cannot handle it during a comparison. The SQL Query that encountered the problem is : {2}.
+
+# A field type is currently not supported.
+#0 : Field name.
+#1 : Unparsable field type.
+#2 : SQL Query that failed.
+excp.unparsable_field_type=The field {0} has a type {1} that is not currently parsable (unsupported yet) in the ''{2}'' query.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver_fr.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/AbstractClauseResolver_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,16 @@
+# Illegal parameter in a where clause.
+#0 : Illegal parameter value.
+#1 : SQL Query that failed.
+excp.illegal_parameter_where=La clause where contient un paramètre qui a une valeur illégale : {0}. La requête SQL qui a échoué est : {1}.
+
+# A type encountered while translating literals and fields value to java types is not Comparable.
+#0 : Value.
+#1 : Java type.
+#2 : SQL Query.
+excp.uncomparable_type=La valeur du champ ou du littéral {0} appartient au type Java {1} qui n''est pas Comparable, et ce driver ne peut pas le prendre en charge durant une comparaison. La requête SQL qui a rencontré ce problème est : {2}.
+
+# A field type is currently not supported.
+#0 : Field name.
+#1 : Unparsable field type.
+#2 : SQL Query that failed.
+excp.unparsable_field_type=Le champ {0} a un type {1} qui n'est pas analysable (non supporté actuellement) dans la requête ''{2}''.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/CrudeSQLParser.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/CrudeSQLParser.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/CrudeSQLParser.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/sql/CrudeSQLParser.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,12 @@
+# Exception thrown when the SQL parser only accepts a degraded request.
+#0 : Request parsed.
+excp.limited_feature_syntax=The SQL parser is yet limited, and only accepts statements starting exactly with ''SELECT * FROM <your_dbf_file_name (without extension)> '', use spaces and not tabs. Your statement ''{0}'' doesn''t match.
+
+# Exception thrown when the parser had not been able to split a condition in three parts (comparand operator comparand) to analyze it.
+#0 : Condition that wasn't parsed.
+#1 : Request parsed.
+excp.limited_feature_conditional_parsing=The SQL parser is limited yet and is only able to parse conditional expressions that are constituted in three parts : comparand1 operator comparand2, separated by spaces. A string containing spaces inside might not be well parsed yet. Your where condition ''{0}'' has been rejected in your SQL statement {1}.
+
+# Exception thrown when a WHERE clause is not followed by one or more conditions.
+#0 : Request parsed.
+excp.where_without_conditions=The WHERE clause has not been followed by a/some condition(s) in your SQL statement : ''{0}''. 

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,22 @@
+# Asserttion : the ResultSet has not been found opened by this statement when it was searched for.
+#0 : the ResultSet that should had been found opened by this statement.
+#1 : The statement.
+assert.resultset_not_opened_by_me=[Internal API trouble] The ResultSet {0} has not been opened by the Statement {1}.  
+
+# Exception thrown if the statement is closed.
+#0 : Underlying DBF File name. 
+excp.closed_statement=The statement to the DBase 3 File {0} is closed.
+
+# Warning : At the time the caller is closing this statement, he has left some ResultSets opened.
+#0, number : Number of ResultSets that are left opened.
+#1 : Opened ResultSets.
+log.resultsets_left_opened={0,number,integer} {0,choice,1#ResultSet is|2#ResultSets are} left opened at the time you are closing this statement : {1}.
+
+# Information : At the time the caller is closing this statement, the current ResultSet was still opened, but this statement will close it.
+#0 : Closed ResultSet.
+log.closing_underlying_resultset=The ResultSet {0} that was left open is closed by this statement.
+
+# toString()
+#0 : Underlying connection.
+#1 : Open state.
+toString='{'(based on connection : {0}), statement open state : {1}'}'

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement_fr.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/internal/shapefile/jdbc/statement/DBFStatement_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,12 @@
+# Exception thrown if the statement is closed.
+#0 : Underlying DBF File name. 
+excp.closed_statement=Le statement au fichier DBase 3 {0} est fermée.
+
+# Warning : At the time the caller is closing this statement, he has left some ResultSets opened.
+#0, number : Number of ResultSets that are left opened.
+#1 : Opened ResultSets.
+log.resultsets_left_opened={0,number,integer} {0,choice,1#ResultSet est|2#ResultSets sont} restés ouverts au moment où vous fermez ce statement : {1}.
+
+# Information : At the time the caller is closing this statement, the current ResultSet was still opened, but this statement will close it.
+#0 : Closed ResultSet.
+log.closing_underlying_resultset=Le ResultSet {0} qui était resté ouvert est fermé par cette fermeture de statement.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,30 @@
+# Exception thrown when there is a file descriptor problem.
+#0 : DBase 3 File who causes trouble.
+#1 : Root cause message.
+excp.filedescriptor_problem=The file descriptor of the ''{0}'' database file is not readable : {1}. Its DBF format seems corrupted.
+
+# Exception thrown when a binary code page value is illegal.
+#0 : Illegal value.
+#1 : DBase 3 file that causes the problem.
+excp.illegal_codepage=The DBase 3 code page binary value {0} doesn''t match a legal binary code page. The DBF file ''{1}'' seems corrupted.
+
+# Exception thrown when a binary code page value is not supported.
+#0 : Unsupported value.
+#1 : DBase 3 file that causes the problem.
+excp.unsupported_codepage=The DBase 3 legacy code page {0} doesn''t have a translation to an known charset. This DBF ''{1}'' cannot be handled.
+
+# Assertion : when this exception occurs, the involved code that produced it is sure to have a bug.
+#0 : Charset that as been asked for and that is wrong.
+#1 : Root cause message.
+assert.wrong_charset_selection=[Internal API trouble] : The Database::toCharset(..) method has selected a wrong charset ''{0}'' that is eventually refused : {1}.
+
+# Database:toString() 
+#0 : Line separator.
+#1 : Database Version.
+#2 : Last update (Date).
+#3 : Feature count (Integer).
+#4 : Field descriptor (Embedded List).
+#5 : Header length (in bytes).
+#6 : Record length (in bytes).
+#7 : Charset (converted from binary code page value).
+toString='{'{0}DBase version : {1}{0}Last update : {2,date,medium}{0}Feature count : {3,number,integer}{0}Field descriptor : {4}{0}Header length : {5}, Record length : {6}, Charset : {7}'}'

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database_fr.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database_fr.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/Database_fr.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,19 @@
+# Exception thrown when there is a file descriptor problem.
+#0 : DBase 3 File who causes trouble.
+#1 : Root cause message.
+excp.filedescriptor_problem=Le descripteur du fichier base de données ''{0}'' n''est pas lisible : {1}. Le format de ce DBF semble corrompu.
+
+# Exception thrown when a binary code page value is illegal.
+#0 : Illegal value.
+#1 : DBase 3 file that causes the problem.
+excp.illegal_codepage=La valeur binaire du code page DBase 3, {0}, ne correspond pas à un code page binaire légal. Le fichier DBF ''{1}'' semble corrompu.
+
+# Exception thrown when a binary code page value is not supported.
+#0 : Unsupported value.
+#1 : DBase 3 file that causes the problem.
+excp.unsupported_codepage=Le code page de la DBase 3, {0}, est ancien et n''a pas de traduction dans un jeu de caractères récent. Ce fichier DBF ''{1}'' ne peut pas être pris en charge.
+
+# Assertion : when this exception occurs, the involved code that produced it is sure to have a bug.
+#0 : Charset that as been asked for and that is wrong.
+#1 : Root cause message.
+assert.wrong_charset_selection=[Problème interne de l''API] : La méthode Database::toCharset(..) a sélectionné un mauvais charset ''{0}'' qui est finalement refusé : {1}.

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldDescriptor.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldDescriptor.properties?rev=1643155&view=auto
==============================================================================
--- sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldDescriptor.properties (added)
+++ sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldDescriptor.properties Fri Dec  5 05:53:23 2014
@@ -0,0 +1,7 @@
+# toString() representation of a Field descriptor.
+#0 : Field name.
+#1 : Field type.
+# Field Address skipped (address is set in memory; not useful on disk).
+#3 : Field length (Integer).
+#4 : Decimal positions (Integer).
+toString='{'Field name : {0}, Type : {1}, Field length : {2,number,integer}, Decimal positions : {3,number,integer}'}'

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldDescriptor_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldDescriptor_fr.properties?rev=1643155&view=auto
==============================================================================
    (empty)

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldsDescriptors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldsDescriptors.properties?rev=1643155&view=auto
==============================================================================
    (empty)

Added: sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldsDescriptors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-shapefile/src/main/resources/org/apache/sis/storage/shapefile/FieldsDescriptors_fr.properties?rev=1643155&view=auto
==============================================================================
    (empty)



Mime
View raw message