File dir = DataUtilities.urlToFile(url);
if (dir != null && dir.isDirectory()) {
return new DirectoryDataStore(DataUtilities.urlToFile(url), new ShpFileStoreFactory(
this, params));
} else {
ShpFiles shpFiles = new ShpFiles(url);
boolean isLocal = shpFiles.isLocal();
boolean useMemoryMappedBuffer = isLocal && isMemoryMapped.booleanValue();
boolean enableIndex = isEnableSpatialIndex.booleanValue() && isLocal;
boolean createIndex = isCreateSpatialIndex.booleanValue() && enableIndex;
// build the store