Class FormatFinder

java.lang.Object
org.apache.sis.internal.storage.image.FormatFinder
All Implemented Interfaces:
AutoCloseable

final class FormatFinder extends Object implements AutoCloseable
Helper class for finding the ImageReader or ImageWriter instance to use. This is a temporary object used only at WorldFileStore construction time. It also helps to choose which WorldFileStore subclass to instantiate.
Since:
1.2
Version:
1.3
  • Field Details

    • provider

      final WorldFileStoreProvider provider
      The factory that created this DataStore instance, or null if unspecified.
    • connector

      final StorageConnector connector
      Information about the storage (URL, stream, etc).
    • keepOpen

      Object keepOpen
      The connector object to keep open if we successfully created a WorldFileStore. This is often the same object than storage but may be different if an ImageInputStream has been created from the storage object.

      This value is null until successful instantiation of image reader or writer. A null value means to close everything, which is the desired behavior in case of failure.

    • storage

      final Object storage
      The file, URL or stream where to read or write the image. If the user-specified storage was an ImageReader or ImageWriter, then the value stored in this field is the input/output of the reader/writer.
    • reader

      private ImageReader reader
      The image reader if specified or created by this FormatFinder, or null.
    • writer

      private ImageWriter writer
      The image writer if specified or created by this FormatFinder, or null.
    • readerLookupDone

      private boolean readerLookupDone
      Whether we already made an attempt to find the image reader or writer using ImageIO registry.
    • writerLookupDone

      private boolean writerLookupDone
      Whether we already made an attempt to find the image reader or writer using ImageIO registry.
    • isWritable

      final boolean isWritable
      true if the storage seems to be writable.
    • openAsWriter

      final boolean openAsWriter
      true if the storage should be open is write mode instead of read mode. This is true if the file does not exist or the file is empty.
    • fileIsEmpty

      final boolean fileIsEmpty
      true if the file is known to be empty, or false in case of doubt.
    • suffix

      final String suffix
      The filename extension (may be an empty string), or null if unknown. It does not include the leading dot.
  • Constructor Details

  • Method Details