if (!it.hasNext())
throw new RuntimeException("processServiceRedirects: No redirect to process!");
// do a depth-first following of redirects
while (it.hasNext()) {
Redirect r = (Redirect)it.next();
URI uri;
try {
uri = new URI(r.getValue());
if (r.getAppend() != null) {
// construct URI
String constructedURI = constructURI(uri, r.getAppend(), qxri);
uri = new URI(constructedURI);
}
} catch (URISyntaxException e) {
XRDS tmpXRDS = new XRDS();
XRD err = createErrorXRD(r.getValue(), Status.INVALID_REDIRECT, "Invalid Redirect URI");
tmpXRDS.add(err);
xrdsOut.add(tmpXRDS);
continue;
}