Hello Marc
Le 04/01/15 22:03, Marc Le Bihan a écrit :
> The Shapefile class could disappear. The way to read Features from a
> shapefile is now :
>
> InputFeatureStream is = new InputFeatureStream(shapeFile, databaseFile); //
> Shapefile (.shp) and Database (.dbf) files.
> Feature feature = is.readFeature(); // null is returned when the end of the
> shapefile / database are reached.
Why InputFeatureStream extends java.io.InputStream? What are the meaning
of the bytes stream? In the source code, the method reading bytes just
throw an UnsupportedOperationException, so why extending InputStream at
all if almost all their methods are unsupported?
> 1) What control can I do on values red on shapefile (not the database part,
> but the shapefile part) to ensure that I am not reading stupid things ?
Could you give an example of what you mean?
> 2) Can we guess Shapefile entry #4 = Record #4 in the Database
I have not yet read the Shapefile specification. What are the difference
between an entry and a record?
> 4) Shall I put all the exceptions in a public package instead of their
> internal package ? I think it would be better.
We could put some of them in an "org.apache.sis.storage.shapefile.sql"
package. However those exceptions are specific to the SIS implementation
of DBase3. Other JDBC driver never throw those exceptions. Consequently,
any generic code designed for arbitrary database (PostgreSQL, Oracle,
etc.) can not depend on those exceptions. Since we try to write Apache
SIS for generic databases, this means that even SIS would not try to
catch those exceptions.
Furthermore all those exceptions extends SQLException, which are not the
kind of exception that we would handle most of the time. The
higher-level API is rather DataStore, which define a DataStoreException.
The SQLException and IOException are lower level mechanic, which would
appear in the "caused by" property of DataStoreException.
Given the above, I do not expect any "catch" clause for those exceptions
outside the Shapefile module. So what would be the use case for making
those exceptions public?
Martin