KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > coldcore > coloradoftp > filesystem > FailedActionException


1 package com.coldcore.coloradoftp.filesystem;
2
3 /**
4  * Exception which is thrown by a filesystem when a requested user action
5  * cannot be performed for some reason.
6  *
7  * Command processor must be aware of this kind of exceptions as they
8  * demand special treatment.
9  *
10  *
11  * ColoradoFTP - The Open Source FTP Server (http://cftp.coldcore.com)
12  */

13 public class FailedActionException extends RuntimeException JavaDoc {
14
15   protected FailedActionReason reason;
16   protected String JavaDoc text;
17
18
19   public FailedActionException(FailedActionReason reason) {
20     this.reason = reason;
21   }
22
23
24   public FailedActionException(FailedActionReason reason, String JavaDoc text) {
25     this.reason = reason;
26     this.text = text;
27   }
28
29
30   /** Get reason of failure
31    * @return Failure reason
32    */

33   public FailedActionReason getReason() {
34     if (reason == null) return FailedActionReason.SYSTEM_ERROR;
35     return reason;
36   }
37
38
39   /** Get optional text
40    * @return Text
41    */

42   public String JavaDoc getText() {
43     return text;
44   }
45 }
46
Popular Tags