BackingStore.getCause()
can be used to get the actual store specific exception.
This method provides a {@link #unwrapOrRethrow(Class)} convenience method which can be usedfor re-throwing the cause as in the example below. This allows client code to behave as if a {@link java.util.Collection} interface was allowed to declare checked exceptions.
{@preformat java}void myMethod() throws IOException Collection c = ...; try { c.doSomeStuff(); } catch (BackingStoreException e) { throw e.unwrapOrRethrow(IOException.class); } } } {@section Relationship withjava.io.UncheckedIOException
}JDK8 provides a {@link java.io.UncheckedIOException} which partially overlapsthe purpose of this {@code BackingStoreException}. While Apache SIS still uses {@code BackingStoreException} as a general mechanism for any kind of checkedexceptions, client code targeting JDK8 would be well advised to catch both kind of exceptions for robustness.
@author Martin Desruisseaux (IRD, Geomatys)
@since 0.3 (derived from geotk-2.3)
@version 0.3
@module
BackingStore.getCause()
can be used to get the actual store specific exception.
@author Mahesh.Kannan@Sun.Com
@author Larry.White@Sun.Com
|
|