File namespaceFile = this.getNamespaceFile(namespace);
String authorityId;
if (! namespaceFile.exists()) {
throw new StoreNotFoundException("Namespace does not exist.");
}
try {
authorityId = FileStore.readLine(namespaceFile);
} catch (Exception ex) {
throw new StoreInternalException(ex, "Cannot find namespace.");
}
File authorityDir = this.getAuthorityDir(authorityId);
if (! authorityDir.exists()) {
throw new StoreNotFoundException("Authority does not exist.");
}
FileAuthority authority = new FileAuthority(authorityDir);
// done