try {
utf8Namespace = IRIUtils.IRItoXRI(IRIUtils.URItoIRI(namespace));
} catch (Exception ex) {
ServerException ex2 = new ServerInternalException("Unsupported encoding in namespace: " + ex.getMessage(), ex);
log.warn("", ex2);
throw ex2;
}
XRIAuthority authorityPath = new GCSAuthority(utf8Namespace);
Authority parentAuthority;
try {
parentAuthority = this.store.localLookup(authorityPath);
if (parentAuthority == null) throw new ServerNotFoundException("Namespace authority " + namespace + " not found.");
} catch (StoreException ex) {
ServerException ex2 = new ServerInternalException("Error while finding namespace authority " + namespace + ": " + ex.getMessage(), ex);
log.warn("", ex2);
throw ex2;
}
// the big goal is to make an XRDS, consisting of one or more XRDs
XRDS xrds = new XRDS();
boolean ret;
// give subclasses a chance to init the XRDS before we begin
ret = this.initXRDS(
xrds,
query,
signed);
// if a subclass returned true, it doesn't want us to do any more work
if (ret == true) {
log.debug("Subclass handled XRDS completely. Returning it without any more work.");
return(xrds);
}
// generate XRDs for all subsegments in the request
String utf8Query;
try {
utf8Query = IRIUtils.IRItoXRI(IRIUtils.URItoIRI(query));
} catch (Exception ex) {
ServerException ex2 = new ServerInternalException("Unsupported encoding in query: " + ex.getMessage(), ex);
log.warn("", ex2);
throw ex2;
}
XRISegment segment = new XRISegment(utf8Query);