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 extends XmlReaderException {
35 /**
36 * Creates an exception instance if the charset encoding could not be determined.
37 * <p>
38 * Instances of this exception are thrown by the XmlReader.
39 * <p>
40 *
41 * @param msg message describing the reason for the exception.
42 * @param bomEnc BOM encoding.
43 * @param xmlGuessEnc XML guess encoding.
44 * @param xmlEnc XML prolog encoding.
45 * @param is the unconsumed InputStream.
46 */
47 public XmlStreamReaderException(String msg, String bomEnc, String xmlGuessEnc, String xmlEnc, InputStream is) {
48 super(msg, bomEnc, xmlGuessEnc, xmlEnc, is);
49 }
50
51 /**
52 * Creates an exception instance if the charset encoding could not be determined.
53 * <p>
54 * Instances of this exception are thrown by the XmlReader.
55 * <p>
56 *
57 * @param msg message describing the reason for the exception.
58 * @param ctMime MIME type in the content-type.
59 * @param ctEnc encoding in the content-type.
60 * @param bomEnc BOM encoding.
61 * @param xmlGuessEnc XML guess encoding.
62 * @param xmlEnc XML prolog encoding.
63 * @param is the unconsumed InputStream.
64 */
65 public XmlStreamReaderException(
66 String msg, String ctMime, String ctEnc, String bomEnc, String xmlGuessEnc, String xmlEnc, InputStream is) {
67 super(msg, ctMime, ctEnc, bomEnc, xmlGuessEnc, xmlEnc, is);
68 }
69 }