HttpResource aRes = new HttpResourceImpl(mURL);
ParameterList aParams = new ParameterList()
.add(PARAM_QUERY, theQuery);
Request aQueryRequest;
Response aResponse = null;
try {
if (mUseGetForQueries) {
aQueryRequest = aRes.initGet()
.addHeader(HttpHeaders.Accept.getName(), RDFFormat.TURTLE.getDefaultMIMEType())
.setParameters(aParams);
}
else {
aQueryRequest = aRes.initPost()
.addHeader(HttpHeaders.ContentType.getName(), MimeTypes.FormUrlEncoded.getMimeType())
.addHeader(HttpHeaders.Accept.getName(), RDFFormat.TURTLE.getDefaultMIMEType())
.setBody(aParams.getURLEncoded());
}
aResponse = aQueryRequest.execute();
if (aResponse.hasErrorCode()) {
throw responseToException(theQuery, aResponse);
}
else {