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