/** * Creates a {@link DataStore} for the given storage. * The {@code storage} argument can be any of the following types: * * <ul> * <li>A {@link java.nio.file.Path} or a {@link java.io.File} for a file or a directory.</li> * <li>A {@link java.net.URI} or a {@link java.net.URL} to a distant resource.</li> * <li>A {@link java.lang.CharSequence} interpreted as a filename or a URL.</li> * <li>A {@link java.nio.channels.Channel}, {@link java.io.DataInput}, {@link java.io.InputStream} or {@link java.io.Reader}.</li> * <li>A {@link javax.sql.DataSource} or a {@link java.sql.Connection} to a JDBC database.</li> * <li>Any other {@code DataStore}-specific object, for example {@link ucar.nc2.NetcdfFile}.</li> * <li>An existing {@link StorageConnector} instance.</li> * </ul> * * @param storage the input/output object as a URL, file, image input stream, <i>etc.</i>. * @return the object to use for reading geospatial data from the given storage. * @throws UnsupportedStorageException if no {@link DataStoreProvider} is found for a given storage object. * @throws DataStoreException if an error occurred while opening the storage. */ public static DataStore open(final Object storage) throws UnsupportedStorageException, DataStoreException { return registry().open(storage); } }
/** * Creates a {@link DataStore} for the given storage. * The {@code storage} argument can be any of the following types: * * <ul> * <li>A {@link java.nio.file.Path} or a {@link java.io.File} for a file or a directory.</li> * <li>A {@link java.net.URI} or a {@link java.net.URL} to a distant resource.</li> * <li>A {@link java.lang.CharSequence} interpreted as a filename or a URL.</li> * <li>A {@link java.nio.channels.Channel}, {@link java.io.DataInput}, {@link java.io.InputStream} or {@link java.io.Reader}.</li> * <li>A {@link javax.sql.DataSource} or a {@link java.sql.Connection} to a JDBC database.</li> * <li>Any other {@code DataStore}-specific object, for example {@link ucar.nc2.NetcdfFile}.</li> * <li>An existing {@link StorageConnector} instance.</li> * </ul> * * @param storage the input/output object as a URL, file, image input stream, <i>etc.</i>. * @return the object to use for reading geospatial data from the given storage. * @throws UnsupportedStorageException if no {@link DataStoreProvider} is found for a given storage object. * @throws DataStoreException if an error occurred while opening the storage. */ public static DataStore open(final Object storage) throws UnsupportedStorageException, DataStoreException { return registry().open(storage); } }