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
9
* http://www.apache.org/licenses/LICENSE-2.0
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.
18
package org.apache.commons.io;
20
import java.io.IOException;
23
* Subclasses IOException with the {@link Throwable} constructors missing before Java 6. If you are using Java 6,
24
* consider this class deprecated and use {@link IOException}.
26
* @author <a href="http://commons.apache.org/io/">Apache Commons IO</a>
28
* @since Commons IO 1.4
30
public class IOExceptionWithCause extends IOException {
33
* Defines the serial version UID.
35
private static final long serialVersionUID = 1L;
38
* Constructs a new instance with the given message and cause.
40
* As specified in {@link Throwable}, the message in the given <code>cause</code> is not used in this instance's
45
* the message (see {@link #getMessage()})
47
* the cause (see {@link #getCause()}). A <code>null</code> value is allowed.
49
public IOExceptionWithCause(String message, Throwable cause) {
51
this.initCause(cause);
55
* Constructs a new instance with the given cause.
57
* The message is set to <code>cause==null ? null : cause.toString()</code>, which by default contains the class
58
* and message of <code>cause</code>. This constructor is useful for call sites that just wrap another throwable.
62
* the cause (see {@link #getCause()}). A <code>null</code> value is allowed.
64
public IOExceptionWithCause(Throwable cause) {
65
super(cause == null ? null : cause.toString());
66
this.initCause(cause);