Class WorldFileStoreProvider
java.lang.Object
org.apache.sis.storage.DataStoreProvider
org.apache.sis.internal.storage.URIDataStore.Provider
org.apache.sis.internal.storage.PRJDataStore.Provider
org.apache.sis.internal.storage.image.WorldFileStoreProvider
The provider of
WorldFileStore instances.- Since:
- 1.2
- Version:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.storage.DataStoreProvider
DataStoreProvider.Prober<S> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanWhether the provider is allowed to createGridCoverageResourceinstances instead ofAggregateinstances.(package private) static final StringThe format name.private static final String[]Name of image formats that are considered to allow only one image.Fields inherited from class org.apache.sis.internal.storage.PRJDataStore.Provider
DEFAULT_CRSFields inherited from class org.apache.sis.internal.storage.URIDataStore.Provider
CREATE_PARAM, ENCODING, LOCATION_PARAMFields inherited from class org.apache.sis.storage.DataStoreProvider
CREATE, LOCATION -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new provider.WorldFileStoreProvider(boolean allowSingleton) Creates a new provider with the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionReturns a generic name for this data store, used mostly in warnings or error messages.open(StorageConnector connector) Returns aWorldFileStoreimplementation associated with this provider.probeContent(StorageConnector connector) Returns the MIME type if the image file is recognized by an Image I/O reader.Methods inherited from class org.apache.sis.internal.storage.PRJDataStore.Provider
build, openMethods inherited from class org.apache.sis.internal.storage.URIDataStore.Provider
connector, descriptor, getOpenParameters, isWritableMethods inherited from class org.apache.sis.storage.DataStoreProvider
getFormat, getLogger, getSupportedVersions, probeContent
-
Field Details
-
NAME
The format name.- See Also:
-
SINGLE_IMAGE_FORMATS
Name of image formats that are considered to allow only one image. There is no public Image I/O API giving this information, so we have to use a hard-coded list. All formats not in this list are assumed to allow more than one image.Case of JPEG
The JPEG image reader implementation in standard JDK seems to count a number of images that can be anything. However, documentation on the web often describes the JPEG format as a container for a single image. It is not clear if we should include JPEG in this list or not. -
allowSingleton
private final boolean allowSingletonWhether the provider is allowed to createGridCoverageResourceinstances instead ofAggregateinstances.
-
-
Constructor Details
-
WorldFileStoreProvider
public WorldFileStoreProvider()Creates a new provider. -
WorldFileStoreProvider
public WorldFileStoreProvider(boolean allowSingleton) Creates a new provider with the given configuration. IfallowSingletonisfalse, then this provider will unconditionally createWorldFileStoreinstances that implement theAggregateinterface, regardless if the image format allows many pictures or not.- Parameters:
allowSingleton- whether the provider is allowed to createGridCoverageResourceinstances instead ofAggregateinstances.
-
-
Method Details
-
getShortName
Returns a generic name for this data store, used mostly in warnings or error messages.- Specified by:
getShortNamein classDataStoreProvider- Returns:
- a short name or abbreviation for the data format.
- See Also:
-
open
Returns aWorldFileStoreimplementation associated with this provider. The data store will be writable ifStandardOpenOption.WRITEis provided, or if the storage is a writable object such asImageOutputStream.- Specified by:
openin 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:
-
probeContent
Returns the MIME type if the image file is recognized by an Image I/O reader. 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:
probeContentin 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 an image.
- Throws:
DataStoreException- if an I/O error occurred.
-