public FileObject getFileFromDigest(final String filename, final String digest) { for (final FileObject file : this) if (file.getFilename().equals(filename) && file.getChecksum().equals(digest)) return file; return null; }
@Override public FileObject remove(final Object file) { if (file instanceof FileObject) super.remove(((FileObject) file).getFilename(true)); if (file instanceof String) return super.remove(FileObject.getFilename((String) file, true)); return null; }
@Override public FileObject get(final Object filename) { return super.get(FileObject.getFilename((String) filename, true)); }
public void add(final FileObject file) { super.put(file.getFilename(true), file); }
public File prefix(final FileObject file) { return prefix(file.getFilename()); }
public UploadableFile(final FilesCollection files, final FileObject file) { this(files.prefix(file), file.getFilename() + "-" + file.getTimestamp()); this.file = file; }