/** * Detect the format of given a file. * * @param file * the file * @return the format, otherwise null if one cannot be detected */ @Nullable public static ClipboardFormat findByFile(File file) { checkNotNull(file); for (ClipboardFormat format : registeredFormats) { if (format.isFormat(file)) { return format; } } return null; }