/** * Returns the reader if it is not closed, or thrown an exception otherwise. */ private Reader reader() throws DataStoreException { final Reader r = reader; if (r == null) { throw new DataStoreClosedException(getLocale(), Constants.GEOTIFF, StandardOpenOption.READ); } return r; }
/** * 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, or requires a shapefile index to be executed and none is available. * @throws DataStoreQueryResultException if the shapefile results cause a trouble (wrong format, for example). * @throws InvalidShapefileFormatException if the shapefile structure shows a problem. */ public AbstractFeature 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); } catch(SQLNoDirectAccessAvailableException e) { throw new DataStoreQueryException(e.getMessage(), e); } }
Object inputOrFile = storage; if (inputOrFile == null) { throw new DataStoreClosedException(getLocale(), getFormatName(), StandardOpenOption.READ);
throw new DataStoreClosedException(getLocale(), getFormatName(), StandardOpenOption.WRITE);