KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > schlichtherle > io > ContainsFileException


1 /*
2  * ContainsFileException.java
3  *
4  * Created on 4. November 2006, 12:26
5  */

6
7 package de.schlichtherle.io;
8
9 import java.io.FileNotFoundException JavaDoc;
10
11 /**
12  * Thrown to indicate that two paths are referring to the same file
13  * or contain each other.
14  * This exception is typically thrown from {@link File#cp}.
15  *
16  * @author Christian Schlichtherle
17  * @version @version@
18  * @since TrueZIP 6.4
19  */

20 public class ContainsFileException extends FileNotFoundException JavaDoc {
21
22     private final java.io.File JavaDoc ancestor, descendant;
23
24     /**
25      * Creates a new instance of <code>ContainsFileException</code>.
26      */

27     public ContainsFileException(
28             final java.io.File JavaDoc ancestor,
29             final java.io.File JavaDoc descendant) {
30         super("Paths refer to the same file or contain each other!");
31         this.ancestor = ancestor;
32         this.descendant = descendant;
33     }
34
35     public java.io.File JavaDoc getAncestor() {
36         return ancestor;
37     }
38
39     public java.io.File JavaDoc getDescendant() {
40         return descendant;
41     }
42 }
43
Popular Tags