Package org.apache.commons.io.input
Class XmlStreamReaderException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- org.apache.commons.io.input.XmlStreamReaderException
-
- All Implemented Interfaces:
java.io.Serializable
public class XmlStreamReaderException extends java.io.IOExceptionThe XmlStreamReaderException is thrown by the XmlStreamReader constructors if the charset encoding cannot be determined according to the XML 1.0 specification and RFC 3023.The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the stream. Note that the original InputStream given to the XmlStreamReader cannot be used as that one has been already read.
- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringbomEncodingThe Byte-Order-Mark (BOM) encoding or null.private java.lang.StringcontentTypeEncodingThe encoding in the content type.private java.lang.StringcontentTypeMimeThe MIME type in the content type.private static longserialVersionUIDprivate java.lang.StringxmlEncodingThe XML encoding.private java.lang.StringxmlGuessEncodingThe guessed encoding.
-
Constructor Summary
Constructors Constructor Description XmlStreamReaderException(java.lang.String msg, java.lang.String bomEnc, java.lang.String xmlGuessEnc, java.lang.String xmlEnc)Constructs an exception instance if the Charset encoding could not be determined.XmlStreamReaderException(java.lang.String msg, java.lang.String ctMime, java.lang.String ctEnc, java.lang.String bomEnc, java.lang.String xmlGuessEnc, java.lang.String xmlEnc)Constructs an exception instance if the Charset encoding could not be determined.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBomEncoding()Gets the BOM encoding found in the InputStream.java.lang.StringgetContentTypeEncoding()Gets the encoding in the content-type used to attempt determining the encoding.java.lang.StringgetContentTypeMime()Gets the MIME type in the content-type used to attempt determining the encoding.java.lang.StringgetXmlEncoding()Gets the encoding found in the XML prolog of the input.java.lang.StringgetXmlGuessEncoding()Gets the encoding guess based on the first bytes of the input.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
bomEncoding
private final java.lang.String bomEncoding
The Byte-Order-Mark (BOM) encoding or null.
-
xmlGuessEncoding
private final java.lang.String xmlGuessEncoding
The guessed encoding.
-
xmlEncoding
private final java.lang.String xmlEncoding
The XML encoding.
-
contentTypeMime
private final java.lang.String contentTypeMime
The MIME type in the content type.
-
contentTypeEncoding
private final java.lang.String contentTypeEncoding
The encoding in the content type.
-
-
Constructor Detail
-
XmlStreamReaderException
public XmlStreamReaderException(java.lang.String msg, java.lang.String bomEnc, java.lang.String xmlGuessEnc, java.lang.String xmlEnc)Constructs an exception instance if the Charset encoding could not be determined.Instances of this exception are thrown by the XmlStreamReader.
- Parameters:
msg- message describing the reason for the exception.bomEnc- BOM encoding.xmlGuessEnc- XML guess encoding.xmlEnc- XML prolog encoding.
-
XmlStreamReaderException
public XmlStreamReaderException(java.lang.String msg, java.lang.String ctMime, java.lang.String ctEnc, java.lang.String bomEnc, java.lang.String xmlGuessEnc, java.lang.String xmlEnc)Constructs an exception instance if the Charset encoding could not be determined.Instances of this exception are thrown by the XmlStreamReader.
- Parameters:
msg- message describing the reason for the exception.ctMime- MIME type in the content-type.ctEnc- encoding in the content-type.bomEnc- BOM encoding.xmlGuessEnc- XML guess encoding.xmlEnc- XML prolog encoding.
-
-
Method Detail
-
getBomEncoding
public java.lang.String getBomEncoding()
Gets the BOM encoding found in the InputStream.- Returns:
- the BOM encoding, null if none.
-
getContentTypeEncoding
public java.lang.String getContentTypeEncoding()
Gets the encoding in the content-type used to attempt determining the encoding.- Returns:
- the encoding in the content-type, null if there was not content-type, no encoding in it or the encoding detection did not involve HTTP.
-
getContentTypeMime
public java.lang.String getContentTypeMime()
Gets the MIME type in the content-type used to attempt determining the encoding.- Returns:
- the MIME type in the content-type, null if there was not content-type or the encoding detection did not involve HTTP.
-
getXmlEncoding
public java.lang.String getXmlEncoding()
Gets the encoding found in the XML prolog of the input.- Returns:
- the encoding of the XML prolog, null if none.
-
getXmlGuessEncoding
public java.lang.String getXmlGuessEncoding()
Gets the encoding guess based on the first bytes of the input.- Returns:
- the encoding guess, null if it couldn't be guessed.
-
-