The supplied patch will cause a NPE if the method is called with a <null> dataFormat argument and there is no file extension that can be matched to a specific RDF format. Ideally, this method would fall back to content negotiation for http-URLs in such cases.
Fair point, I had not realized that dataFormat could be null.
Doesn't adding an if around the setRequestProperty solve this?
if (dataFormat != null) {
connection.setProperty("Accept", dataFormat.getDefaultMimeType());
}
That would fix the NPE, but only bring us half-way. When passing a <null> parameter, it would be better to accept any format that can be parsed.
Resolved in svn rev 10428.