return Collections.unmodifiableMap(hf);
}
public void setRequestMethod(final String method) throws ProtocolException {
if (connected) {
throw new ProtocolException("Can't reset method: already connected");
}
if (fOutputStream != null) {
// TODO: or just clear the output stream?
// TODO: or allow change between Post and Put?
throw new ProtocolException("Can't reset method: output stream already allocated");
}
LOG.info("setRequestMethod(" + method + ")");
if ("GET".equals(method)) {
setHttpRequestMethod(new GetMethod(url.toExternalForm()));
} else if ("POST".equals(method)) {
setHttpRequestMethod(new PostMethod(url.toExternalForm()));
} else {
throw new ProtocolException("Not implemented/Invalid HTTP method: " + method);
}
}