Response resp = read(url);
AtomBase base = parse(resp.getStream(), AtomBase.class);
// get the entry
AtomEntry entry = null;
if (base instanceof AtomFeed) {
AtomFeed feed = (AtomFeed) base;
if (feed.getEntries().isEmpty()) {
throw new CmisRuntimeException("Parent feed is empty!");
}
entry = feed.getEntries().get(0);
} else if (base instanceof AtomEntry) {
entry = (AtomEntry) base;
} else {
throw new CmisRuntimeException("Unexpected document!");
}
lockLinks();
try {
// clean up cache
removeLinks(repositoryId, entry.getId());
// walk through the entry
for (AtomElement element : entry.getElements()) {
if (element.getObject() instanceof AtomLink) {
addLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
} else if (element.getObject() instanceof CmisObjectType) {
result = convert((CmisObjectType) element.getObject());
}
}
} finally {