KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > filesys > smb > SMBException


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.filesys.smb;
18
19 /**
20  * SMB exception class
21  * <p>
22  * This class holds the detail of an SMB network error. The SMB error class and error code are
23  * available to give extra detail about the error condition.
24  */

25 public class SMBException extends Exception JavaDoc
26 {
27     private static final long serialVersionUID = 3256719593644176946L;
28
29     // SMB error class
30

31     protected int m_errorclass;
32
33     // SMB error code
34

35     protected int m_errorcode;
36
37     /**
38      * Construct an SMB exception with the specified error class/error code.
39      */

40
41     public SMBException(int errclass, int errcode)
42     {
43         super(SMBErrorText.ErrorString(errclass, errcode));
44         m_errorclass = errclass;
45         m_errorcode = errcode;
46     }
47
48     /**
49      * Construct an SMB exception with the specified error class/error code and additional text
50      * error message.
51      */

52
53     public SMBException(int errclass, int errcode, String JavaDoc msg)
54     {
55         super(msg);
56         m_errorclass = errclass;
57         m_errorcode = errcode;
58     }
59
60     /**
61      * Return the error class for this SMB exception.
62      *
63      * @return SMB error class.
64      */

65
66     public int getErrorClass()
67     {
68         return m_errorclass;
69     }
70
71     /**
72      * Return the error code for this SMB exception
73      *
74      * @return SMB error code
75      */

76
77     public int getErrorCode()
78     {
79         return m_errorcode;
80     }
81
82     /**
83      * Return the error text for the SMB exception
84      *
85      * @return Error text string.
86      */

87
88     public String JavaDoc getErrorText()
89     {
90         return SMBErrorText.ErrorString(m_errorclass, m_errorcode);
91     }
92 }
Popular Tags