Improve atom link matching

This commit is contained in:
Shinokuni 2019-02-18 15:36:39 +00:00
parent 7dcdcb68fb
commit 2211017472
1 changed files with 6 additions and 14 deletions

View File

@ -90,19 +90,11 @@ public class ATOMEntry extends AItem {
}
public String getUrl() {
if (links.size() > 0) {
if (links.get(0).getRel() == null)
return links.get(0).getHref();
else {
if (links.size() > 1) {
if (links.get(1).getRel() == null)
return links.get(1).getHref();
else
return null;
} else
return null;
}
} else
return null;
for (ATOMLink link : links) {
if (link.getRel() == null || link.getRel().equals("self") || link.getRel().equals("alternate"))
return link.getHref();
}
return null;
}
}