Package org.apache.sis.storage
Class DataStores
-
public final class DataStores extends Static
Static convenience methods creatingDataStoreinstances from a given storage object. Storage objects are typicallyFileorDataSourceinstances, but can also be any other objects documented in theStorageConnectorclass.- Since:
- 0.4
Defined in the
sis-storagemodule
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataStoreopen(Object storage)Creates aDataStorefor the given storage.static StringprobeContentType(Object storage)Returns the MIME type of the storage file format, ornullif unknown or not applicable.static Collection<DataStoreProvider>providers()Returns the set of data store providers available at this method invocation time.
-
-
-
Method Detail
-
providers
public static Collection<DataStoreProvider> providers()
Returns the set of data store providers available at this method invocation time. More providers may be added later in a running JVM if new modules are added on the classpath.- Returns:
- descriptions of available data stores.
- Since:
- 0.8
-
probeContentType
public static String probeContentType(Object storage) throws DataStoreException
Returns the MIME type of the storage file format, ornullif unknown or not applicable.- Parameters:
storage- the input/output object as a URL, file, image input stream, etc..- Returns:
- the storage MIME type, or
nullif unknown or not applicable. - Throws:
DataStoreException- if an error occurred while opening the storage.
-
open
public static DataStore open(Object storage) throws UnsupportedStorageException, DataStoreException
Creates aDataStorefor the given storage. Thestorageargument can be any of the following types:- A
Pathor aFilefor a file or a directory. - A
URIor aURLto a distant resource. - A
CharSequenceinterpreted as a filename or a URL. - A
Channel,DataInput,InputStreamorReader. - A
DataSourceor aConnectionto a JDBC database. - Any other
DataStore-specific object, for exampleNetcdfFile. - An existing
StorageConnectorinstance.
- Parameters:
storage- the input/output object as a URL, file, image input stream, etc..- Returns:
- the object to use for reading geospatial data from the given storage.
- Throws:
UnsupportedStorageException- if noDataStoreProvideris found for a given storage object.DataStoreException- if an error occurred while opening the storage.
- A
-
-