Class StoreProvider
java.lang.Object
org.apache.sis.storage.DataStoreProvider
org.apache.sis.internal.storage.folder.StoreProvider
The provider of
Store
instances. This provider is intentionally registered with lowest priority
because it will open any directory, which may conflict with other providers opening only directory with
some specific content.- Since:
- 0.8
- Version:
- 1.1
-
Nested Class Summary
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<Charset>
Description of the parameter for character encoding used by the data store.private static final org.opengis.parameter.ParameterDescriptor<String>
Description of the parameter for name of format orDataStoreProvider
to use for reading or writing the directory content.private static final org.opengis.parameter.ParameterDescriptor<Locale>
Description of the parameter for formatting conventions of dates and numbers.(package private) static final String
A short name or abbreviation for the data format.(package private) static final org.opengis.parameter.ParameterDescriptorGroup
The group of parameter descriptors to be returned bygetOpenParameters()
.private static final org.opengis.parameter.ParameterDescriptor<TimeZone>
Description of the parameter for timezone of dates in the data store.Fields inherited from class org.apache.sis.storage.DataStoreProvider
CREATE, LOCATION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> org.opengis.parameter.ParameterDescriptor<T>
annotate
(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<T> e, org.opengis.util.InternationalString remark) Creates a parameter descriptor equals to the given one except for the remarks which are set to the given value.org.opengis.parameter.ParameterDescriptorGroup
Returns a description of all parameters accepted by this provider for opening a data store.Returns a short name or abbreviation for the data format.open
(StorageConnector connector) Returns a data store implementation associated with this provider.private DataStore
open
(StorageConnector connector, String format, EnumSet<StandardOpenOption> options) Shared implementation of publicopen(…)
methods.open
(org.opengis.parameter.ParameterValueGroup parameters) Returns a data store implementation associated with this provider for the given parameters.probeContent
(StorageConnector connector) ReturnsProbeResult.SUPPORTED
if the given storage appears to be a folder.Methods inherited from class org.apache.sis.storage.DataStoreProvider
getFormat, getLogger, getSupportedVersions, probeContent
-
Field Details
-
NAME
A short name or abbreviation for the data format.- See Also:
-
LOCALE
Description of the parameter for formatting conventions of dates and numbers. -
TIMEZONE
Description of the parameter for timezone of dates in the data store. -
ENCODING
Description of the parameter for character encoding used by the data store. -
FORMAT
Description of the parameter for name of format orDataStoreProvider
to use for reading or writing the directory content. -
PARAMETERS
static final org.opengis.parameter.ParameterDescriptorGroup PARAMETERSThe group of parameter descriptors to be returned bygetOpenParameters()
.
-
-
Constructor Details
-
StoreProvider
public StoreProvider()Creates a new provider.
-
-
Method Details
-
annotate
private static <T> org.opengis.parameter.ParameterDescriptor<T> annotate(ParameterBuilder builder, org.opengis.parameter.ParameterDescriptor<T> e, org.opengis.util.InternationalString remark) Creates a parameter descriptor equals to the given one except for the remarks which are set to the given value. -
getShortName
Returns a short name or abbreviation for the data format.- Specified by:
getShortName
in classDataStoreProvider
- Returns:
- a short name or abbreviation for the data format.
- See Also:
-
getOpenParameters
public org.opengis.parameter.ParameterDescriptorGroup getOpenParameters()Returns a description of all parameters accepted by this provider for opening a data store.- Specified by:
getOpenParameters
in classDataStoreProvider
- Returns:
- description of the parameters for opening a
DataStore
. - See Also:
-
probeContent
ReturnsProbeResult.SUPPORTED
if the given storage appears to be a folder. ReturningSUPPORTED
from this method 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 storage characteristics.- Specified by:
probeContent
in classDataStoreProvider
- Parameters:
connector
- information about the storage (URL, stream, JDBC connection, etc).- Returns:
ProbeResult.SUPPORTED
if the given storage seems to be readable as a folder.- Throws:
DataStoreException
- if an I/O error occurred.
-
open
Returns a data store implementation associated with this provider. The data store created by this method will try to auto-detect the format of every files in the directory. For exploring only the file of a known format, useopen(ParameterValueGroup)
instead.- Specified by:
open
in classDataStoreProvider
- Parameters:
connector
- information about the storage (URL, path, 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
private DataStore open(StorageConnector connector, String format, EnumSet<StandardOpenOption> options) throws DataStoreException Shared implementation of publicopen(…)
methods. Note that this method may modify the givenoptions
set for its own purpose.- Parameters:
connector
- information about the storage (URL, path, etc).format
- format name for directory content, ornull
if unspecified.options
- whether to create a new directory, overwrite existing content, etc.- Throws:
DataStoreException
-
open
public DataStore open(org.opengis.parameter.ParameterValueGroup parameters) throws DataStoreException Returns a data store implementation associated with this provider for the given parameters.- Overrides:
open
in classDataStoreProvider
- Parameters:
parameters
- opening parameters as defined byDataStoreProvider.getOpenParameters()
.- Returns:
- a folder data store implementation for the given parameters.
- Throws:
DataStoreException
- if an error occurred while creating the data store instance.- See Also:
-