org.geotools.data.shapefile
Class ShapefileDirectoryFactory
Object
AbstractDataStoreFactory
ShapefileDataStoreFactory
ShapefileDirectoryFactory
- All Implemented Interfaces:
- DataAccessFactory, DataStoreFactorySpi, FileDataStoreFactorySpi, Factory
public class ShapefileDirectoryFactory
- extends ShapefileDataStoreFactory
Creates a directory datastore pointing to a directory of shapefiles
- Author:
- Andrea Aime
Method Summary |
boolean |
canProcess(Map params)
Default implementation verifies the Map against the Param information. |
String |
getDescription()
Describe the nature of the datasource constructed by this factory. |
String |
getDisplayName()
Default Implementation abuses the naming convention. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLP
public static final DataAccessFactory.Param URLP
- The directory to be scanned for file data stores
ShapefileDirectoryFactory
public ShapefileDirectoryFactory()
getDisplayName
public String getDisplayName()
- Description copied from class:
AbstractDataStoreFactory
- Default Implementation abuses the naming convention.
Will return Foo
for
org.geotools.data.foo.FooFactory
.
- Specified by:
getDisplayName
in interface DataAccessFactory
- Overrides:
getDisplayName
in class ShapefileDataStoreFactory
- Returns:
- return display name based on class name
getDescription
public String getDescription()
- Description copied from interface:
DataAccessFactory
- Describe the nature of the datasource constructed by this factory.
A non localized description of this data store type.
- Specified by:
getDescription
in interface DataAccessFactory
- Overrides:
getDescription
in class ShapefileDataStoreFactory
- Returns:
- A human readable description that is suitable for inclusion in a
list of available datasources.
canProcess
public boolean canProcess(Map params)
- Description copied from class:
AbstractDataStoreFactory
- Default implementation verifies the Map against the Param information.
It will ensure that:
- params is not null
- Everything is of the correct type (or upcovertable
to the correct type without Error)
- Required Parameters are present
Why would you ever want to override this method?
If you want to check that a expected file exists and is a directory.
Overrride:
public boolean canProcess( Map params ) {
if( !super.canProcess( params ) ){
return false; // was not in agreement with getParametersInfo
}
// example check
File file = (File) DIRECTORY.lookup( params ); // DIRECTORY is a param
return file.exists() && file.isDirectory();
}
- Specified by:
canProcess
in interface DataAccessFactory
- Overrides:
canProcess
in class ShapefileDataStoreFactory
- Parameters:
params
- The full set of information needed to construct a live
data source.
- Returns:
- true if params is in agreement with getParametersInfo, override for additional checks.
Copyright © 1996-2014 Geotools. All Rights Reserved.