private ReadonlyFile<?> getFile(String docid) throws RepositoryException {
ReadonlyFile<?> file = pathParser.getFile(docid, context.getCredentials());
if (file == null) {
// Not one of our registered filesystems.
throw new DocumentNotFoundException("Failed to open file: " + docid);
}
if (!file.exists()) {
// File actually does not exist.
throw new DocumentNotFoundException("File not found: " + docid);
}
// Verify that we would have actually fed this document.
if (!isQualifiedFile(file)) {
// File may or may-not exist, but it is not available to us.
throw new SkippedDocumentException("Access denied: " + docid);