Class StoreProvider
java.lang.Object
org.apache.sis.storage.DataStoreProvider
org.apache.sis.internal.storage.URIDataStore.Provider
org.apache.sis.internal.storage.csv.StoreProvider
The provider of
Store
instances. Given a StorageConnector
input,
this class tries to instantiate a CSV Store
.
Thread safety
The sameStoreProvider
instance can be safely used by many threads without synchronization on
the part of the caller. However, the Store
instances created by this factory are not thread-safe.- Since:
- 0.8
- Version:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
The object to use for verifying if the first keyword is the expected one.Nested classes/interfaces inherited from class org.apache.sis.storage.DataStoreProvider
DataStoreProvider.Prober<S>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.opengis.parameter.ParameterDescriptor<FoliationRepresentation>
Description of the optional parameter for specifying whether the reader should assemble distinct CSV lines into a singleFeature
instance forming a foliation.(package private) static final String
The format names for static features and moving features.(package private) static final String
The format names for static features and moving features.Fields inherited from class org.apache.sis.internal.storage.URIDataStore.Provider
CREATE_PARAM, ENCODING, LOCATION_PARAM
Fields inherited from class org.apache.sis.storage.DataStoreProvider
CREATE, LOCATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.opengis.parameter.ParameterDescriptorGroup
build
(ParameterBuilder builder) Invoked byURIDataStore.Provider.getOpenParameters()
the first time that a parameter descriptor needs to be created.Returns a generic name for this data store, used mostly in warnings or error messages.open
(StorageConnector connector) Returns a CSVStore
implementation associated with this provider.open
(org.opengis.parameter.ParameterValueGroup parameters) Returns a CSVStore
implementation from the given parameters.probeContent
(StorageConnector connector) Returns the MIME type if the given storage appears to be supported by CSVStore
.Methods inherited from class org.apache.sis.internal.storage.URIDataStore.Provider
connector, descriptor, getOpenParameters, isWritable
Methods inherited from class org.apache.sis.storage.DataStoreProvider
getFormat, getLogger, getSupportedVersions, probeContent
-
Field Details
-
NAME
The format names for static features and moving features.- See Also:
-
MOVING
The format names for static features and moving features.- See Also:
-
FOLIATION
Description of the optional parameter for specifying whether the reader should assemble distinct CSV lines into a singleFeature
instance forming a foliation. This is ignored if the CSV file does not seem to contain moving features.
-
-
Constructor Details
-
StoreProvider
public StoreProvider()Creates a new provider.
-
-
Method Details
-
getShortName
Returns a generic name for this data store, used mostly in warnings or error messages.- Specified by:
getShortName
in classDataStoreProvider
- Returns:
- a short name or abbreviation for the data format.
- See Also:
-
probeContent
Returns the MIME type if the given storage appears to be supported by CSVStore
. A supported status does not guarantee that reading or writing will succeed, only that there appears to be a reasonable chance of success based on a brief inspection of the file header.- Specified by:
probeContent
in classDataStoreProvider
- Parameters:
connector
- information about the storage (URL, stream, JDBC connection, etc).- Returns:
- a supported status with the MIME type if the given storage seems to be readable as a CSV file.
- Throws:
DataStoreException
- if an I/O error occurred.
-
open
Returns a CSVStore
implementation associated with this provider.- Specified by:
open
in classDataStoreProvider
- Parameters:
connector
- information about the storage (URL, stream, etc).- Returns:
- a data store implementation associated with this provider for the given storage.
- Throws:
DataStoreException
- if an error occurred while creating the data store instance.- See Also:
-
open
public DataStore open(org.opengis.parameter.ParameterValueGroup parameters) throws DataStoreException Returns a CSVStore
implementation from the given parameters.- Overrides:
open
in classDataStoreProvider
- Parameters:
parameters
- opening parameters as defined byDataStoreProvider.getOpenParameters()
.- Returns:
- a data store implementation associated with this provider for the given parameters.
- Throws:
DataStoreException
- if an error occurred while creating the data store instance.- See Also:
-
build
Invoked byURIDataStore.Provider.getOpenParameters()
the first time that a parameter descriptor needs to be created.- Overrides:
build
in classURIDataStore.Provider
- Parameters:
builder
- the builder to use for creating parameter descriptor. The group name is already set.- Returns:
- the parameters descriptor for CSV files.
-