public void dispose() { wrapped.dispose(); }
if (ds != null) ds.dispose(); if (reader != null) reader.close();
@Override public void dispose() { store.dispose(); } }
@Override public void dispose() { datastore.dispose(); }
public void dispose() { delegate.dispose(); }
protected void handleInitializationException(Throwable t) { try { if (tileIndexStore != null) tileIndexStore.dispose(); } catch (Throwable e1) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e1.getLocalizedMessage(), e1); } finally { this.tileIndexStore = null; } }
protected void disposeTileIndexStore() { try { if (tileIndexStore != null) { tileIndexStore.dispose(); } } catch (Throwable e) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } } finally { this.tileIndexStore = null; } }
public void dispose() { final Lock l = rwLock.writeLock(); try { l.lock(); try { if (slicesIndexStore != null && !repositoryStore) slicesIndexStore.dispose(); } catch (Throwable e) { if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, e.getLocalizedMessage(), e); } finally { slicesIndexStore = null; } } finally { l.unlock(); } }
void dispose() { DataStore store = ref != null ? ref.get() : null; if (store != null) store.dispose(); ref.clear(); } }
protected void generalizeShapeFile( String shapeFileName, String targetDirName, String generalizations) throws IOException { File shapeFile = new File(shapeFileName); if (shapeFile.exists() == false) throw new IOException("Could not find " + shapeFileName); DataStore shapeDS = new ShapefileDataStoreFactory().createDataStore(shapeFile.toURI().toURL()); File targetDir = new File(targetDirName); if (targetDir.exists() == false) throw new IOException("Could not find " + targetDir); String[] distanceStrings = generalizations.split(","); Double[] distanceArray = new Double[distanceStrings.length]; for (int i = 0; i < distanceStrings.length; i++) distanceArray[i] = new Double(distanceStrings[i]); generalizeShapeFile(shapeFile, shapeDS, targetDir, distanceArray); shapeDS.dispose(); }
@Override public void clear() { DataStore store = get(); if (store != null) store.dispose(); super.clear(); } }
@Override public String getTypeName(URL url) throws IOException { DataStore ds = createDataStore(url); String[] names = ds.getTypeNames(); // should be exactly one ds.dispose(); return ((names == null || names.length == 0) ? null : names[0]); } }
public void createSchema(SimpleFeatureType featureType) throws IOException { File f = new File(cache.directory, featureType.getTypeName() + ".shp"); Map<String, Serializable> params = new HashMap<String, Serializable>(); params.put("url", URLs.fileToUrl(f)); params.put("filetype", "shapefile"); DataStore ds = null; try { ds = DataStoreFinder.getDataStore(params); if (ds != null) { ds.createSchema(featureType); ds.dispose(); cache.refreshCacheContents(); } } catch (Exception e) { throw (IOException) new IOException("Error creating new data store").initCause(e); } if (ds == null) { throw new IOException("Could not find the shapefile data store in the classpath"); } }
@After public void dispose() { if (shapeFileDataStore != null) { shapeFileDataStore.dispose(); } }
+ configPath); dataStore.dispose(); } catch (Exception e) { throw new ConfigurationException(
} finally { executorService.shutdown(); if (targetStore != null) targetStore.dispose();
try { if (slicesIndexStore != null) { slicesIndexStore.dispose();
private String[] getFilesFromStore(LinkedHashSet<String> filePaths) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException { DataStore sourceStore = H2MigrateConfiguration.getDataStore(configuration.getSourceStoreConfiguration()); final String[] indexTables = configuration.getIndexTables() != null ? configuration.getIndexTables() : getCoverageNames(); try { final List<String> typeNames = Arrays.asList(sourceStore.getTypeNames()); for (String indexTable : indexTables) { if (!typeNames.contains(indexTable)) { throw new MigrationException( "Could not find source index table " + indexTable + ", the available ones are " + typeNames); } final List<String> coverageFiles = collectFilesFromTable(sourceStore, indexTable); filePaths.addAll(coverageFiles); } } finally { if (sourceStore != null) { sourceStore.dispose(); } } return indexTables; }
t.close(); if (sourceDataStore != null) { sourceDataStore.dispose();