class ShapefileDataStoreFactory implements FileDataStoreFactorySpi {

    @Override
    public boolean canProcess(Map params) {
        if (!DataUtilities.canProcess(params, getParametersInfo())) {
            return false; // fail basic param check
        }
        try {
            URL url = (URL) URLP.lookUp(params);
            if (canProcess(url)) {
                return true;
            } else {
                // maybe it's a directory?
                Object fileType = FILE_TYPE.lookUp(params);
                File dir = DataUtilities.urlToFile(url);
                // check for null fileType for backwards compatibility
                return dir.isDirectory() && (fileType == null || "shapefile".equals(fileType));
            }
        } catch (IOException e) {
            return false;
        }
    }

}