~ubuntu-branches/ubuntu/quantal/commons-io/quantal

« back to all changes in this revision

Viewing changes to src/java/org/apache/commons/io/IOExceptionWithCause.java

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2008-02-21 13:26:43 UTC
  • mfrom: (1.1.3 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080221132643-p4c8f8lhb9rnqnlo
Tags: 1.4-1
* New upstream release
* Bump Standards-Version to 3.7.3
* Bump up debhelper compat to 6
* Replace XS-Vcs headers with Vcs
* debian/patches:
  - remove 01_no_ext_links.dpatch - not required
  - remove 02_no_mkdir_in_homedir.dpatch - not required
* Remove dpatch from Build-Depends
* Update debian/rules and debian/libcommons-io-java-doc.install
  with new target dirs
* debian/copyright: add copyright notice

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 * @author <a href="http://commons.apache.org/io/">Apache Commons IO</a>
 
27
 * @version $Id$
 
28
 * @since Commons IO 1.4
 
29
 */
 
30
public class IOExceptionWithCause extends IOException {
 
31
 
 
32
    /**
 
33
     * Defines the serial version UID.
 
34
     */
 
35
    private static final long serialVersionUID = 1L;
 
36
 
 
37
    /**
 
38
     * Constructs a new instance with the given message and cause.
 
39
     * <p>
 
40
     * As specified in {@link Throwable}, the message in the given <code>cause</code> is not used in this instance's
 
41
     * message.
 
42
     * </p>
 
43
     * 
 
44
     * @param message
 
45
     *            the message (see {@link #getMessage()})
 
46
     * @param cause
 
47
     *            the cause (see {@link #getCause()}). A <code>null</code> value is allowed.
 
48
     */
 
49
    public IOExceptionWithCause(String message, Throwable cause) {
 
50
        super(message);
 
51
        this.initCause(cause);
 
52
    }
 
53
 
 
54
    /**
 
55
     * Constructs a new instance with the given cause.
 
56
     * <p>
 
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.
 
59
     * </p>
 
60
     * 
 
61
     * @param cause
 
62
     *            the cause (see {@link #getCause()}). A <code>null</code> value is allowed.
 
63
     */
 
64
    public IOExceptionWithCause(Throwable cause) {
 
65
        super(cause == null ? null : cause.toString());
 
66
        this.initCause(cause);
 
67
    }
 
68
 
 
69
}