/** * Returns a numbered path relative to the root of this service, but is * ignorant of FS and similar constructs. For example, given an id of * 123456 this will return "ROOT/Files/Dir-123/Dir-456/123456" * * @param id the Files identifier * @return the path relative to the root */ public String getFilesPath(Long id) { return getPath(FILES_PATH, id); }
public ThumbnailFileDeletions(AbstractFileSystemService afs, Set<Long> deletedIds) { super(afs, deletedIds); for (Long id : deletedIds) { String filePath = afs.getThumbnailPath(id); addLocalFile(new File(filePath), id); } } }
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); } } } } }
String filePath = afs.getFilesPath(dlm.getFileId()); addLocalFile(new File(filePath), dlm.getFileId()); for (Long id : orderedIds) { String filePath = afs.getFilesPath(id); File file = new File(filePath); fail(file, id, null);
/** * Returns a numbered path relative to the root of this service, but is * ignorant of FS and similar constructs. For example, given an id of * 12345 this will return "ROOT/Pixels/Dir-123/Dir-456/123456" * * @param id the Pixels identifier * @return the path relative to the root */ public String getPixelsPath(Long id) { return getPath(PIXELS_PATH, id); }
/** * Returns a numbered path relative to the root of this service, but is * ignorant of FS and similar constructs. For example, given an id of * 123456 this will return "ROOT/Thumbnails/Dir-123/Dir-456/123456" * * @param id the thumbnail identifier * @return the path relative to the root */ public String getThumbnailPath(Long id) { return getPath(THUMBNAILS_PATH, id); }