/** * Returns the list of files in a folder using NIO API. * * @param basePath The parent folder * @return The list of files * @throws IOException */ public static List<Path> listFiles(Path basePath) throws IOException { return listFiles(basePath, 1); }
@Override public void close() throws IOException { //JAI.getDefaultInstance().getTileCache().flush(); if (product != null) { for (Band band : product.getBands()) { MultiLevelImage sourceImage = band.getSourceImage(); if (sourceImage != null) { sourceImage.reset(); sourceImage.dispose(); sourceImage = null; } } } List<Path> files = PathUtils.listFiles(tmpFolder); tmpFolder.toFile().deleteOnExit(); if (files != null) { for (Path file : files) { file.toFile().deleteOnExit(); } } super.close(); }