APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.util

public final Class HTTPInputSource

extends XMLInputSource
Class Inheritance
Imports
com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier, com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource, java.io.InputStream, .Reader, java.util.HashMap, .Iterator, .Map

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.
Author
Michael Glavassevich, IBM

Field Summary

Modifier and TypeField and Description
protected boolean
fFollowRedirects

Preference for whether HTTP redirects should be followed.

protected Map<String, String>
fHTTPRequestProperties

HTTP request properties.

Inherited from com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource:
fBaseSystemIdfByteStreamfCharStreamfEncodingfPublicIdfSystemId

Constructor Summary

AccessConstructor and Description
public
HTTPInputSource(String
The public identifier, if known.
publicId
,
String
The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
systemId
,
String
The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
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.

public
HTTPInputSource(XMLResourceIdentifier
the XMLResourceIdentifier containing the information
resourceIdentifier
)

Constructs an input source from a XMLResourceIdentifier object, leaving resolution of the entity and opening of the input stream up to the caller.

public
HTTPInputSource(String
The public identifier, if known.
publicId
,
String
The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
systemId
,
String
The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
baseSystemId
,
InputStream
The byte stream.
byteStream
,
String
The encoding of the byte stream, if known.
encoding
)

Constructs an input source from a byte stream.

public
HTTPInputSource(String
The public identifier, if known.
publicId
,
String
The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.
systemId
,
String
The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.
baseSystemId
,
Reader
The character stream.
charStream
,
String
The original encoding of the byte stream used by the reader, if known.
encoding
)

Constructs an input source from a character stream.

Method Summary

Modifier and TypeMethod and Description
public boolean
getFollowHTTPRedirects()

Returns the preference whether HTTP redirects should be followed.

public Iterator<Map.Entry<String, String>>

Returns:

an iterator for the request properties this input source contains
getHTTPRequestProperties
()

Returns an iterator for the request properties this input source contains.

public String

Returns:

the value of the request property or null if this property has not been set
getHTTPRequestProperty
(String
the name of the request property
key
)

Returns the value of the request property associated with the given property name.

public void
setFollowHTTPRedirects(boolean followRedirects)

Sets the preference whether HTTP redirects should be followed.

public void
setHTTPRequestProperty(String
the name of the request property
key
,
String
the value of the request property
value
)

Sets the value of the request property associated with the given property name.

Inherited from com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource:
getBaseSystemIdgetByteStreamgetCharacterStreamgetEncodinggetPublicIdgetSystemIdisCreatedByResolversetBaseSystemIdsetByteStreamsetCharacterStreamsetCreatedByResolversetEncodingsetPublicIdsetSystemId

Field Detail

fFollowRedirectsback to summary
protected boolean fFollowRedirects

Preference for whether HTTP redirects should be followed.

fHTTPRequestPropertiesback to summary
protected Map<String, String> fHTTPRequestProperties

HTTP request properties.

Constructor Detail

HTTPInputSourceback to 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.

Parameters
publicId:String

The public identifier, if known.

systemId:String

The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.

baseSystemId:String

The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.

HTTPInputSourceback to summary
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.

Parameters
resourceIdentifier:XMLResourceIdentifier

the XMLResourceIdentifier containing the information

HTTPInputSourceback to summary
public HTTPInputSource(String publicId, String systemId, String baseSystemId, InputStream byteStream, String encoding)

Constructs an input source from a byte stream.

Parameters
publicId:String

The public identifier, if known.

systemId:String

The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.

baseSystemId:String

The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.

byteStream:InputStream

The byte stream.

encoding:String

The encoding of the byte stream, if known.

HTTPInputSourceback to summary
public HTTPInputSource(String publicId, String systemId, String baseSystemId, Reader charStream, String encoding)

Constructs an input source from a character stream.

Parameters
publicId:String

The public identifier, if known.

systemId:String

The system identifier. This value should always be set, if possible, and can be relative or absolute. If the system identifier is relative, then the base system identifier should be set.

baseSystemId:String

The base system identifier. This value should always be set to the fully expanded URI of the base system identifier, if possible.

charStream:Reader

The character stream.

encoding:String

The original encoding of the byte stream used by the reader, if known.

Method Detail

getFollowHTTPRedirectsback to summary
public boolean getFollowHTTPRedirects()

Returns the preference whether HTTP redirects should be followed. By default HTTP redirects will be followed.

getHTTPRequestPropertiesback to summary
public Iterator<Map.Entry<String, String>> 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.

Returns:Iterator<Map.Entry<String, String>>

an iterator for the request properties this input source contains

getHTTPRequestPropertyback to summary
public String getHTTPRequestProperty(String key)

Returns the value of the request property associated with the given property name.

Parameters
key:String

the name of the request property

Returns:String

the value of the request property or null if this property has not been set

setFollowHTTPRedirectsback to summary
public void setFollowHTTPRedirects(boolean followRedirects)

Sets the preference whether HTTP redirects should be followed. By default HTTP redirects will be followed.

setHTTPRequestPropertyback to summary
public void setHTTPRequestProperty(String key, String value)

Sets the value of the request property associated with the given property name.

Parameters
key:String

the name of the request property

value:String

the value of the request property