1 /*
2 * Copyright 2004 Sun Microsystems, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17 package org.codehaus.plexus.util.xml;
18
19 import java.io.InputStream;
20
21 /**
22 * The XmlStreamReaderException is thrown by the XmlStreamReader constructors if the charset encoding can not be
23 * determined according to the XML 1.0 specification and RFC 3023.
24 * <p>
25 * The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the
26 * stream. Note that the original InputStream given to the XmlStreamReader cannot be used as that one has been already
27 * read.
28 * <p>
29 *
30 * @author Alejandro Abdelnur
31 * @version revision 1.1 taken on 26/06/2007 from Rome (see
32 * https://rome.dev.java.net/source/browse/rome/src/java/com/sun/syndication/io/XmlReaderException.java)
33 */
34 public class XmlStreamReaderException
35 extends XmlReaderException
36 {
37 /**
38 * Creates an exception instance if the charset encoding could not be determined.
39 * <p>
40 * Instances of this exception are thrown by the XmlReader.
41 * <p>
42 *
43 * @param msg message describing the reason for the exception.
44 * @param bomEnc BOM encoding.
45 * @param xmlGuessEnc XML guess encoding.
46 * @param xmlEnc XML prolog encoding.
47 * @param is the unconsumed InputStream.
48 */
49 public XmlStreamReaderException( String msg, String bomEnc, String xmlGuessEnc, String xmlEnc, InputStream is )
50 {
51 super( msg, bomEnc, xmlGuessEnc, xmlEnc, is );
52 }
53
54 /**
55 * Creates an exception instance if the charset encoding could not be determined.
56 * <p>
57 * Instances of this exception are thrown by the XmlReader.
58 * <p>
59 *
60 * @param msg message describing the reason for the exception.
61 * @param ctMime MIME type in the content-type.
62 * @param ctEnc encoding in the content-type.
63 * @param bomEnc BOM encoding.
64 * @param xmlGuessEnc XML guess encoding.
65 * @param xmlEnc XML prolog encoding.
66 * @param is the unconsumed InputStream.
67 */
68 public XmlStreamReaderException( String msg, String ctMime, String ctEnc, String bomEnc, String xmlGuessEnc,
69 String xmlEnc, InputStream is )
70 {
71 super( msg, ctMime, ctEnc, bomEnc, xmlGuessEnc, xmlEnc, is );
72 }
73 }