Coverage Report - org.apache.commons.io.IOExceptionWithCause
 
Classes in this File Line Coverage Branch Coverage Complexity
IOExceptionWithCause
100%
6/6
50%
1/2
1.5
 
 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. If you are using Java 6,
 24  
  * consider this class deprecated and use {@link IOException}.
 25  
  * 
 26  
  * @version $Id: IOExceptionWithCause.java 1415850 2012-11-30 20:51:39Z ggregory $
 27  
  * @since 1.4
 28  
  */
 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</code> 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  32
         super(message);
 50  32
         this.initCause(cause);
 51  32
     }
 52  
 
 53  
     /**
 54  
      * Constructs a new instance with the given cause.
 55  
      * <p>
 56  
      * The message is set to <code>cause==null ? null : cause.toString()</code>, which by default contains the class
 57  
      * and message of <code>cause</code>. This constructor is useful for call sites that just wrap another throwable.
 58  
      * </p>
 59  
      * 
 60  
      * @param cause
 61  
      *            the cause (see {@link #getCause()}). A {@code null} value is allowed.
 62  
      */
 63  
     public IOExceptionWithCause(final Throwable cause) {
 64  2
         super(cause == null ? null : cause.toString());
 65  2
         this.initCause(cause);
 66  2
     }
 67  
 
 68  
 }