Class IncompatibleResourceException

Object
Throwable
Exception
DataStoreException
IncompatibleResourceException
All Implemented Interfaces:
Serializable, Localized­Exception

public class IncompatibleResourceException extends DataStoreException
Thrown when a write operation cannot be performed because the resource to write is incompatible with the data store. For example, the file format may have restrictions that prevent the encoding of the coordinate reference system used by the resource. The get­Aspects() method can help to identify which aspects (class, CRS, etc.) are the causes of the incompatibility.
Since:
1.2
See Also:
  • Constructor Details

    • IncompatibleResourceException

      public IncompatibleResourceException()
      Creates an exception with no cause and no details message.
    • IncompatibleResourceException

      public IncompatibleResourceException(String message)
      Creates an exception with the specified details message.
      Parameters:
      message - the detail message.
    • IncompatibleResourceException

      public IncompatibleResourceException(String message, Throwable cause)
      Creates an exception with the specified details message and cause.
      Parameters:
      message - the detail message.
      cause - the cause for this exception.
  • Method Details

    • addAspect

      public IncompatibleResourceException addAspect(String name)
      Adds an identification of the aspect which is the cause of the incompatibility. It should be the name of a property such as "crs" or "grid­To­CRS". See get­Aspects() for a list of suggested values.
      Parameters:
      name - an identification of the aspect which is incompatible.
      Returns:
      this for method call chaining.
      Since:
      1.5
    • getAspects

      public Set<String> getAspects()
      Returns identifications of the aspects which are causes of the incompatibility. Some values are:
      • "class": the resources is not an instance of the class expected by the writer.
      • "crs": the coordinate reference system cannot be encoded.
      • "grid­To­CRS": the "grid to CRS" component of the grid geometry of a raster cannot be encoded.
      • "grid­Geometry": the grid geometry of a raster cannot be encoded for reason less specific than grid­To­CRS.
      • "raster": the raster data cannot be encoded.
      • "unit": the unit of measurement cannot be encoded.
      Returns:
      identifications of aspects which are incompatible.
      Since:
      1.5