HTTPInputSourcepublic final class HTTPInputSource extends XMLInputSource This class represents an input source for an XML resource
retrievable over HTTP. In addition to the properties
provided by an XMLInputSource an HTTP input
source also has HTTP request properties and a preference
whether HTTP redirects will be followed. Note that these
properties will only be used if reading this input source
will induce an HTTP connection. |
Fields Summary |
---|
protected boolean | fFollowRedirectsPreference for whether HTTP redirects should be followed. | protected Map | fHTTPRequestPropertiesHTTP request properties. |
Constructors Summary |
---|
public HTTPInputSource(String publicId, String systemId, String baseSystemId)Constructs an input source from just the public and system
identifiers, leaving resolution of the entity and opening of
the input stream up to the caller.
//
// Constructors
//
super(publicId, systemId, baseSystemId);
| public HTTPInputSource(XMLResourceIdentifier resourceIdentifier)Constructs an input source from a XMLResourceIdentifier
object, leaving resolution of the entity and opening of
the input stream up to the caller.
super(resourceIdentifier);
| public HTTPInputSource(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding)Constructs an input source from a byte stream.
super(publicId, systemId, baseSystemId, byteStream, encoding);
| public HTTPInputSource(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding)Constructs an input source from a character stream.
super(publicId, systemId, baseSystemId, charStream, encoding);
|
Methods Summary |
---|
public boolean | getFollowHTTPRedirects()Returns the preference whether HTTP redirects should
be followed. By default HTTP redirects will be followed.
return fFollowRedirects;
| public java.util.Iterator | getHTTPRequestProperties()Returns an iterator for the request properties this
input source contains. Each object returned by the
iterator is an instance of java.util.Map.Entry
where each key and value are a pair of strings corresponding
to the name and value of a request property.
return fHTTPRequestProperties.entrySet().iterator();
| public java.lang.String | getHTTPRequestProperty(java.lang.String key)Returns the value of the request property
associated with the given property name.
return (String) fHTTPRequestProperties.get(key);
| public void | setFollowHTTPRedirects(boolean followRedirects)Sets the preference whether HTTP redirects should
be followed. By default HTTP redirects will be followed.
fFollowRedirects = followRedirects;
| public void | setHTTPRequestProperty(java.lang.String key, java.lang.String value)Sets the value of the request property
associated with the given property name.
if (value != null) {
fHTTPRequestProperties.put(key, value);
}
else {
fHTTPRequestProperties.remove(key);
}
|
|