Thrown to indicate that an operation could not complete because of a failure in the backing store (a file or a database). This exception is thrown by collection implementations that are not allowed to throw checked exceptions. This exception usually has an {@link IOException} ora {@link SQLException} as its {@linkplain #getCause() cause}.
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 with
java.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