Module org.apache.sis.storage.netcdf
Package org.apache.sis.storage.netcdf

# Class NetcdfStoreProvider

Object
DataStoreProvider
NetcdfStoreProvider

public class NetcdfStoreProvider extends DataStoreProvider
The provider of `NetcdfStore` instances. Given a `StorageConnector` input, this class tries to instantiate a `NetcdfStore` using the embedded netCDF decoder. If the embedded decoder cannot decode the given input and the UCAR library is reachable on the module path, then this class tries to instantiate a `NetcdfStore` backed by the UCAR library.

## Thread safety

The same `NetcdfStoreProvider` instance can be safely used by many threads without synchronization on the part of the caller. However, the `NetcdfStore` instances created by this factory are not thread-safe.

Since:
  0.3
See Also:
  - `NetcdfStore`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class DataStoreProvider

  `DataStoreProvider​.Prober<S>`

- ## Field Summary

  ### Fields inherited from class DataStoreProvider

  `CREATE, LOCATION`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NetcdfStoreProvider()`
  Creates a new provider.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Logger`
  `getLogger()`
  Returns the logger used by netCDF stores.
  `ParameterDescriptorGroup`
  `getOpenParameters()`
  Returns a description of all parameters accepted by this provider for opening a netCDF file.
  `String`
  `getShortName()`
  Returns a generic name for this data store, used mostly in warnings or error messages.
  `DataStore`
  `open(StorageConnector connector)`
  Returns a `NetcdfStore` implementation associated with this provider.
  `ProbeResult`
  `probeContent(StorageConnector connector)`
  Returns the MIME type if the given storage appears to be supported by `NetcdfStore`.

  ### Methods inherited from class DataStoreProvider

  `getFormat, getSupportedVersions, open, probeContent`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NetcdfStoreProvider

    public NetcdfStoreProvider()
    Creates a new provider.

- ## Method Details

  - ### getShortName

    public String getShortName()
    Returns a generic name for this data store, used mostly in warnings or error messages.
    Specified by:
      `getShortName` in class `DataStoreProvider`
    Returns:
      a short name or abbreviation for the data format.
    See Also:
      - `DataStoreProvider​.getFormat()`

  - ### getOpenParameters

    public ParameterDescriptorGroup getOpenParameters()
    Returns a description of all parameters accepted by this provider for opening a netCDF file.
    Specified by:
      `getOpenParameters` in class `DataStoreProvider`
    Returns:
      description of available parameters for opening a netCDF file.
    Since:
      0.8
    See Also:
      - `DataStoreProvider​.LOCATION`
      - `DataStoreProvider​.CREATE`
      - `DataStoreProvider​.open(ParameterValueGroup)`
      - `DataStore​.getOpenParameters()`

  - ### probeContent

    public ProbeResult probeContent(StorageConnector connector) throws DataStoreException
    Returns the MIME type if the given storage appears to be supported by `NetcdfStore`. 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 class `DataStoreProvider`
    Parameters:
      `connector` - information about the storage (URL, stream, `NetcdfFile` instance, etc).
    Returns:
      a supported status with the MIME type if the given storage seems to be readable by `NetcdfStore` instances.
    Throws:
      `DataStoreException` - if an I/O error occurred.

  - ### open

    public DataStore open(StorageConnector connector) throws DataStoreException
    Returns a `NetcdfStore` implementation associated with this provider.
    Specified by:
      `open` in class `DataStoreProvider`
    Parameters:
      `connector` - information about the storage (URL, stream, `NetcdfFile` instance, 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:
      - `DataStores​.open(Object)`

  - ### getLogger

    public Logger getLogger()
    Returns the logger used by netCDF stores..
    Overrides:
      `getLogger` in class `DataStoreProvider`
    Returns:
      the logger used by netCDF stores
    See Also:
      - `StoreListeners​.getLogger()`