View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.io;
19  
20  import java.io.IOException;
21  
22  /**
23   * Subclasses IOException with the {@link Throwable} constructors missing before Java 6.
24   *
25   * @since 1.4
26   * @deprecated (since 2.5) use {@link IOException} instead
27   */
28  @Deprecated
29  public class IOExceptionWithCause extends IOException {
30  
31      /**
32       * Defines the serial version UID.
33       */
34      private static final long serialVersionUID = 1L;
35  
36      /**
37       * Constructs a new instance with the given message and cause.
38       * <p>
39       * As specified in {@link Throwable}, the message in the given {@code cause} is not used in this instance's
40       * message.
41       * </p>
42       *
43       * @param message
44       *            the message (see {@link #getMessage()})
45       * @param cause
46       *            the cause (see {@link #getCause()}). A {@code null} value is allowed.
47       */
48      public IOExceptionWithCause(final String message, final Throwable cause) {
49          super(message, cause);
50      }
51  
52      /**
53       * Constructs a new instance with the given cause.
54       * <p>
55       * The message is set to {@code cause==null ? null : cause.toString()}, which by default contains the class
56       * and message of {@code cause}. This constructor is useful for call sites that just wrap another throwable.
57       * </p>
58       *
59       * @param cause
60       *            the cause (see {@link #getCause()}). A {@code null} value is allowed.
61       */
62      public IOExceptionWithCause(final Throwable cause) {
63          super(cause);
64      }
65  
66  }