org.geotools.data
Class DataStoreFinder

java.lang.Object
  extended byorg.geotools.data.DataStoreFinder

public final class DataStoreFinder
extends java.lang.Object

Enable programs to find all available datastore implementations.

In order to be located by this finder datasources must provide an implementation of the DataStoreFactorySpi interface.

In addition to implementing this interface datasouces should have a services file:
META-INF/services/org.geotools.data.DataStoreFactorySpi

The file should contain a single line which gives the full name of the implementing class.

Example:
org.geotools.data.mytype.MyTypeDataStoreFacotry

The use of this class may be hidden by an implementation of the Catalog interface in later release.


Method Summary
static java.util.Iterator getAvailableDataSources()
          Finds all implemtaions of DataStoreFactory which have registered using the services mechanism.
static DataStore getDataStore(java.util.Map params)
          Checks each available datasource implementation in turn and returns the first one which claims to support the resource identified by the params object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDataStore

public static DataStore getDataStore(java.util.Map params)
                              throws java.io.IOException
Checks each available datasource implementation in turn and returns the first one which claims to support the resource identified by the params object.

Parameters:
params - A Map object which contains a defenition of the resource to connect to. for file based resources the property 'url' should be set within this Map.
Returns:
The first datasource which claims to process the required resource, returns null if none can be found.
Throws:
java.io.IOException - If a suitable loader can be found, but it can not be attached to the specified resource without errors.

getAvailableDataSources

public static java.util.Iterator getAvailableDataSources()
Finds all implemtaions of DataStoreFactory which have registered using the services mechanism.

Returns:
An iterator over all discovered datastores which have registered factories.


Copyright © 1996-2003 GeoTools. All Rights Reserved.