public PixelsFileDeletions(AbstractFileSystemService afs, Set<Long> deletedIds) { super(afs, deletedIds); for (Long id : deletedIds) { final String filePath = afs.getPixelsPath(id); final File file = new File(filePath); final File pyrFile = new File(filePath + PixelsService.PYRAMID_SUFFIX); final File dir = file.getParentFile(); final File lockFile = new File(dir, "." + id + PixelsService.PYRAMID_SUFFIX + BfPyramidPixelBuffer.PYR_LOCK_EXT); // Remove the Pyramid file itself addLocalFile(file, id); // Try to remove a _pyramid file if it exists addLocalFile(pyrFile, id); // Now any lock file addLocalFile(lockFile, id); // Now any tmp files FileFilter tmpFileFilter = new WildcardFileFilter("." + id + PixelsService.PYRAMID_SUFFIX + "*.tmp"); File[] tmpFiles = dir.listFiles(tmpFileFilter); if(tmpFiles != null) { for (int i = 0; i < tmpFiles.length; i++) { addLocalFile(tmpFiles[i], id); } } } } }