HTTPClient httpClient = getRepository().getHTTPClient();
if (inputStreamOrReader instanceof InputStream) {
httpClient.upload(((InputStream)inputStreamOrReader), baseURI, dataFormat, false, contexts);
}
else if (inputStreamOrReader instanceof Reader) {
httpClient.upload(((Reader)inputStreamOrReader), baseURI, dataFormat, false, contexts);
}
else {
throw new IllegalArgumentException(
"inputStreamOrReader must be an InputStream or a Reader, is a: "
+ inputStreamOrReader.getClass());