for (File file : third.listFiles()) {
if (!file.canRead() || !file.isFile()) continue;
String filename = file.getName();
// SHA-1s should be 40 characters ...
if (filename.length() != 40) continue;
BinaryKey key = new BinaryKey(file.getName());
// There is a trash file for this key, meaning the file is unused
if (getTrashFile(key, false) != null) continue;
keys.add(key);
// exclude mime types (which will be seen as binaries)
BinaryKey mimeTypeKey = createKeyFromSourceWithSuffix(key, MIME_TYPE_SUFFIX);
keysToExclude.add(mimeTypeKey);
// exclude extracted text
BinaryKey textKey = createKeyFromSourceWithSuffix(key, EXTRACTED_TEXT_SUFFIX);
keysToExclude.add(textKey);
}
}
}
}