|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fi.iki.hsivonen.xml.PrudentHttpEntityResolver
public class PrudentHttpEntityResolver
Field Summary | |
---|---|
private boolean |
acceptAllKnownXmlTypes
|
private boolean |
allowGenericXml
|
private boolean |
allowHtml
|
private boolean |
allowRnc
|
private boolean |
allowXhtml
|
private static Pattern |
CHARSET
|
private static org.apache.commons.httpclient.HttpClient |
client
|
private ErrorHandler |
errorHandler
|
private com.hp.hpl.jena.iri.IRIFactory |
iriFactory
|
private boolean |
laxContentType
|
private static org.apache.log4j.Logger |
log4j
|
private static org.apache.commons.httpclient.MultiThreadedHttpConnectionManager |
manager
|
private static int |
maxRequests
|
private int |
requestsLeft
|
private int |
sizeLimit
|
Constructor Summary | |
---|---|
PrudentHttpEntityResolver(int sizeLimit,
boolean laxContentType,
ErrorHandler errorHandler)
|
Method Summary | |
---|---|
private String |
buildAccept()
|
boolean |
isAcceptAllKnownXmlTypes()
Returns the acceptAllKnownXmlTypes. |
boolean |
isAllowGenericXml()
Returns the allowGenericXml. |
boolean |
isAllowHtml()
Returns the allowHtml. |
boolean |
isAllowRnc()
|
boolean |
isAllowXhtml()
Returns the allowXhtml. |
boolean |
isOnlyHtmlAllowed()
|
InputSource |
resolveEntity(String publicId,
String systemId)
|
protected boolean |
rncContentType(String type,
InputSource is)
|
void |
setAcceptAllKnownXmlTypes(boolean acceptAllKnownXmlTypes)
Sets the acceptAllKnownXmlTypes. |
void |
setAllowGenericXml(boolean allowGenericXml)
Sets the allowGenericXml. |
void |
setAllowHtml(boolean expectHtml)
|
void |
setAllowRnc(boolean allowRnc)
|
void |
setAllowXhtml(boolean allowXhtml)
Sets the allowXhtml. |
static void |
setParams(int connectionTimeout,
int socketTimeout,
int maxRequests)
Sets the timeouts of the HTTP client. |
static void |
setUserAgent(String ua)
|
protected boolean |
xmlContentType(String type,
InputSource is)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger log4j
private static final Pattern CHARSET
private static final org.apache.commons.httpclient.MultiThreadedHttpConnectionManager manager
private static final org.apache.commons.httpclient.HttpClient client
private static int maxRequests
private int sizeLimit
private ErrorHandler errorHandler
private int requestsLeft
private boolean laxContentType
private boolean allowRnc
private boolean allowHtml
private boolean allowXhtml
private boolean acceptAllKnownXmlTypes
private boolean allowGenericXml
private com.hp.hpl.jena.iri.IRIFactory iriFactory
Constructor Detail |
---|
public PrudentHttpEntityResolver(int sizeLimit, boolean laxContentType, ErrorHandler errorHandler)
connectionTimeout
- socketTimeout
- sizeLimit
- Method Detail |
---|
public static void setParams(int connectionTimeout, int socketTimeout, int maxRequests)
connectionTimeout
- timeout until connection established in milliseconds. Zero
means no timeout.socketTimeout
- timeout for waiting for data in milliseconds. Zero means no
timeout.public static void setUserAgent(String ua)
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
resolveEntity
in interface EntityResolver
SAXException
IOException
EntityResolver.resolveEntity(java.lang.String,
java.lang.String)
protected boolean xmlContentType(String type, InputSource is) throws SAXException
SAXException
protected boolean rncContentType(String type, InputSource is) throws SAXException
SAXException
public boolean isAllowRnc()
public void setAllowRnc(boolean allowRnc)
allowRnc
- The allowRnc to set.public void setAllowHtml(boolean expectHtml)
b
- public boolean isAcceptAllKnownXmlTypes()
public void setAcceptAllKnownXmlTypes(boolean acceptAllKnownXmlTypes)
acceptAllKnownXmlTypes
- the acceptAllKnownXmlTypes to setpublic boolean isAllowGenericXml()
public void setAllowGenericXml(boolean allowGenericXml)
allowGenericXml
- the allowGenericXml to setpublic boolean isAllowXhtml()
public void setAllowXhtml(boolean allowXhtml)
allowXhtml
- the allowXhtml to setprivate String buildAccept()
public boolean isAllowHtml()
public boolean isOnlyHtmlAllowed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |