public final class DataStores extends Static
DataStore
instances from a given storage object.
Storage objects are typically File
or DataSource
instances,
but can also be any other objects documented in the StorageConnector
class.Defined in the sis-storage
module
Modifier and Type | Method and Description |
---|---|
static DataStore |
open(Object storage)
Creates a
DataStore for the given storage. |
static String |
probeContentType(Object storage)
Returns the MIME type of the storage file format, or
null if unknown or not applicable. |
public static String probeContentType(Object storage) throws DataStoreException
null
if unknown or not applicable.storage
- The input/output object as a URL, file, image input stream, etc..null
if unknown or not applicable.DataStoreException
- If an error occurred while opening the storage.public static DataStore open(Object storage) throws UnsupportedStorageException, DataStoreException
DataStore
for the given storage.
The storage
argument can be any of the following types:
File
for a file or a directory.URI
or a URL
to a distant resource.CharSequence
interpreted as a filename or a URL.Channel
, DataInput
, InputStream
or Reader
.DataSource
or a Connection
to a JDBC database.DataStore
-specific object, for example NetcdfFile
.StorageConnector
instance.storage
- The input/output object as a URL, file, image input stream, etc..UnsupportedStorageException
- if no DataStoreProvider
is found for a given storage object.DataStoreException
- If an error occurred while opening the storage.Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.