Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../img/srcFileCovDistChart0.png 88% of files have more coverage
14   131   8   1,75
0   42   0,57   8
8     1  
1    
 
  XmlReaderException       Line # 20 14 8 0% 0.0
 
No Tests
 
1    package com.sun.syndication.io;
2   
3   
4    import java.io.InputStream;
5    import java.io.IOException;
6   
7    /**
8    * The XmlReaderException is thrown by the XmlReader constructors if the charset encoding can not be
9    * determined according to the XML 1.0 specification and RFC 3023.
10    * <p>
11    * The exception returns the unconsumed InputStream to allow the application to do an alternate
12    * processing with the stream. Note that the original InputStream given to the XmlReader cannot be
13    * used as that one has been already read.
14    * <p>
15    *
16    * @author Alejandro Abdelnur
17    * @version revision 1.8 taken on 2008-03-06 from Rome (see
18    * https://rome.dev.java.net/source/browse/rome/src/java/com/sun/syndication/io/XmlReaderException.java)
19    */
 
20    public class XmlReaderException extends IOException {
21    private String _bomEncoding;
22    private String _xmlGuessEncoding;
23    private String _xmlEncoding;
24    private String _contentTypeMime;
25    private String _contentTypeEncoding;
26    private InputStream _is;
27   
28    /**
29    * Creates an exception instance if the charset encoding could not be determined.
30    * <p>
31    * Instances of this exception are thrown by the XmlReader.
32    * <p>
33    *
34    * @param msg message describing the reason for the exception.
35    * @param bomEnc BOM encoding.
36    * @param xmlGuessEnc XML guess encoding.
37    * @param xmlEnc XML prolog encoding.
38    * @param is the unconsumed InputStream.
39    */
 
40  0 toggle public XmlReaderException(String msg,String bomEnc,String xmlGuessEnc,String xmlEnc,InputStream is) {
41  0 this(msg,null,null,bomEnc,xmlGuessEnc,xmlEnc,is);
42    }
43   
44    /**
45    * Creates an exception instance if the charset encoding could not be determined.
46    * <p>
47    * Instances of this exception are thrown by the XmlReader.
48    * <p>
49    *
50    * @param msg message describing the reason for the exception.
51    * @param ctMime MIME type in the content-type.
52    * @param ctEnc encoding in the content-type.
53    * @param bomEnc BOM encoding.
54    * @param xmlGuessEnc XML guess encoding.
55    * @param xmlEnc XML prolog encoding.
56    * @param is the unconsumed InputStream.
57    */
 
58  0 toggle public XmlReaderException(String msg,String ctMime,String ctEnc,
59    String bomEnc,String xmlGuessEnc,String xmlEnc,InputStream is) {
60  0 super(msg);
61  0 _contentTypeMime = ctMime;
62  0 _contentTypeEncoding = ctEnc;
63  0 _bomEncoding = bomEnc;
64  0 _xmlGuessEncoding = xmlGuessEnc;
65  0 _xmlEncoding = xmlEnc;
66  0 _is = is;
67    }
68   
69    /**
70    * Returns the BOM encoding found in the InputStream.
71    * <p>
72    *
73    * @return the BOM encoding, null if none.
74    */
 
75  0 toggle public String getBomEncoding() {
76  0 return _bomEncoding;
77    }
78   
79    /**
80    * Returns the encoding guess based on the first bytes of the InputStream.
81    * <p>
82    *
83    * @return the encoding guess, null if it couldn't be guessed.
84    */
 
85  0 toggle public String getXmlGuessEncoding() {
86  0 return _xmlGuessEncoding;
87    }
88   
89    /**
90    * Returns the encoding found in the XML prolog of the InputStream.
91    * <p>
92    *
93    * @return the encoding of the XML prolog, null if none.
94    */
 
95  0 toggle public String getXmlEncoding() {
96  0 return _xmlEncoding;
97    }
98   
99    /**
100    * Returns the MIME type in the content-type used to attempt determining the encoding.
101    * <p>
102    *
103    * @return the MIME type in the content-type, null if there was not content-type or the encoding
104    * detection did not involve HTTP.
105    */
 
106  0 toggle public String getContentTypeMime() {
107  0 return _contentTypeMime;
108    }
109   
110    /**
111    * Returns the encoding in the content-type used to attempt determining the encoding.
112    * <p>
113    *
114    * @return the encoding in the content-type, null if there was not content-type, no encoding in
115    * it or the encoding detection did not involve HTTP.
116    */
 
117  0 toggle public String getContentTypeEncoding() {
118  0 return _contentTypeEncoding;
119    }
120   
121    /**
122    * Returns the unconsumed InputStream to allow the application to do an alternate encoding
123    * detection on the InputStream.
124    * <p>
125    *
126    * @return the unconsumed InputStream.
127    */
 
128  0 toggle public InputStream getInputStream() {
129  0 return _is;
130    }
131    }