org.geotools.data.shapefile
Class ShapefileDirectoryFactory

Object
  extended by AbstractDataStoreFactory
      extended by ShapefileDataStoreFactory
          extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class ShapefileDataStoreFactory
ShapefileDataStoreFactory.ShpFileStoreFactory
 
Nested classes/interfaces inherited from interface DataAccessFactory
DataAccessFactory.Param
 
Field Summary
static DataAccessFactory.Param URLP
          The directory to be scanned for file data stores
 
Fields inherited from class ShapefileDataStoreFactory
CACHE_MEMORY_MAPS, CREATE_SPATIAL_INDEX, DBFCHARSET, DBFTIMEZONE, ENABLE_SPATIAL_INDEX, FILE_TYPE, FSTYPE, MEMORY_MAPPED, NAMESPACEP
 
Constructor Summary
ShapefileDirectoryFactory()
           
 
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 ShapefileDataStoreFactory
canProcess, createDataStore, createDataStore, createNewDataStore, getFileExtensions, getImplementationHints, getParametersInfo, getTypeName, isAvailable
 
Methods inherited from class AbstractDataStoreFactory
getParameters
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URLP

public static final DataAccessFactory.Param URLP
The directory to be scanned for file data stores

Constructor Detail

ShapefileDirectoryFactory

public ShapefileDirectoryFactory()
Method Detail

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:

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.