Class CoverageIO


  • public class CoverageIO
    extends Object
    A class containing static convenience methods for locating CoverageAccesss and specific CoverageSources, and performing simple encoding and decoding.
    Author:
    Simone Giannecchini, GeoSolutions, Jody Garnett
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canConnect​(Map<String,​Serializable> params)
      Test to see if this factory is suitable for processing the data pointed to by the params map.
      static CoverageAccess connect​(Map<String,​Serializable> params)  
      static CoverageAccess connect​(Map<String,​Serializable> params, Hints hints, ProgressListener listener)  
      static Driver findDriver​(URL url)
      Returns a Driver that is able to read a certain object.
      static Set<Driver> findDrivers​(URL url)
      Returns all the Drivers that can read the supplied URL url.
      static Set<Driver> getAvailableDrivers()
      Finds all available implementations of Driver which have registered using the services mechanism, and that have the appropriate libraries on the class-path.
      static Driver[] getAvailableDriversArray()
      Returns an array with all available Driver implementations.
      static void scanForPlugins()
      Scans for factory plug-ins on the application class path.
      • Methods inherited from class Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • canConnect

        public static boolean canConnect​(Map<String,​Serializable> params)
        Test to see if this factory is suitable for processing the data pointed to by the params map.

        If this datasource requires a number of parameters then this method should check that they are all present and that they are all valid. If the datasource is a file reading data source then the extensions or mime types of any files specified should be checked. For example, a Shapefile datasource should check that the url param ends with shp, such tests should be case insensitive.

        Parameters:
        params - The full set of information needed to construct a live data source.
        Returns:
        boolean true if and only if this factory can process the resource indicated by the param set and all the required params are present.
      • connect

        public static CoverageAccess connect​(Map<String,​Serializable> params)
                                      throws IOException
        Throws:
        IOException
      • getAvailableDrivers

        public static Set<Driver> getAvailableDrivers()
        Finds all available implementations of Driver which have registered using the services mechanism, and that have the appropriate libraries on the class-path.
        Returns:
        An unmodifiable Set of all discovered drivers which have registered factories, and whose available method returns true.
      • scanForPlugins

        public static void scanForPlugins()
        Scans for factory plug-ins on the application class path. This method is needed because the application class path can theoretically change, or additional plug-ins may become available. Rather than re-scanning the class-path on every invocation of the API, the class path is scanned automatically only on the first invocation. Clients can call this method to prompt a re-scan. Thus this method need only be invoked by sophisticated applications which dynamically make new plug-ins available at runtime.
      • getAvailableDriversArray

        public static Driver[] getAvailableDriversArray()
        Returns an array with all available Driver implementations.

        It can be used together basic information about all the available GridCoverage plugins. Note that this method finds all the implemented plugins but returns only the available one.

        A plugin could be implemented but not available due to missing dependencies.

        Returns:
        an array with all available Driver implementations.
      • findDrivers

        public static Set<Driver> findDrivers​(URL url)
        Returns all the Drivers that can read the supplied URL url.
        Parameters:
        url - is the object to search a Driver that is able to read
        Returns:
        an unmodifiable Set comprising all the Driver that can read the URL url.
      • findDriver

        public static Driver findDriver​(URL url)
        Returns a Driver that is able to read a certain object. If no Driver is able to read such an Object we return an null object.
        Parameters:
        url - the object to check for acceptance.
        Returns:
        a Driver that has stated to accept this URL o or null in no plugins was able to accept it.