IOExceptionWithCause.java

  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. package org.apache.commons.io;

  18. import java.io.IOException;

  19. /**
  20.  * Subclasses IOException with the {@link Throwable} constructors missing before Java 6.
  21.  *
  22.  * @since 1.4
  23.  * @deprecated (since 2.5) use {@link IOException} instead
  24.  */
  25. @Deprecated
  26. public class IOExceptionWithCause extends IOException {

  27.     /**
  28.      * Defines the serial version UID.
  29.      */
  30.     private static final long serialVersionUID = 1L;

  31.     /**
  32.      * Constructs a new instance with the given message and cause.
  33.      * <p>
  34.      * As specified in {@link Throwable}, the message in the given {@code cause} is not used in this instance's
  35.      * message.
  36.      * </p>
  37.      *
  38.      * @param message
  39.      *            the message (see {@link #getMessage()})
  40.      * @param cause
  41.      *            the cause (see {@link #getCause()}). A {@code null} value is allowed.
  42.      */
  43.     public IOExceptionWithCause(final String message, final Throwable cause) {
  44.         super(message, cause);
  45.     }

  46.     /**
  47.      * Constructs a new instance with the given cause.
  48.      * <p>
  49.      * The message is set to {@code cause==null ? null : cause.toString()}, which by default contains the class
  50.      * and message of {@code cause}. This constructor is useful for call sites that just wrap another throwable.
  51.      * </p>
  52.      *
  53.      * @param cause
  54.      *            the cause (see {@link #getCause()}). A {@code null} value is allowed.
  55.      */
  56.     public IOExceptionWithCause(final Throwable cause) {
  57.         super(cause);
  58.     }

  59. }