KickJava   Java API By Example, From Geeks To Geeks.

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


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 device types class.
21  * <p>
22  * The class provides symbols for the remote device types that may be connected to. The values are
23  * also used when returning remote share information.
24  */

25 public class SMBDeviceType
26 {
27
28     // Device type constants
29

30     public static final int Disk = 0;
31     public static final int Printer = 1;
32     public static final int Comm = 2;
33     public static final int Pipe = 3;
34     public static final int Unknown = -1;
35
36     /**
37      * Convert the device type to a string
38      *
39      * @param devtyp Device type
40      * @return Device type string
41      */

42     public static String JavaDoc asString(int devtyp)
43     {
44         String JavaDoc devStr = null;
45
46         switch (devtyp)
47         {
48         case Disk:
49             devStr = "Disk";
50             break;
51         case Printer:
52             devStr = "Printer";
53             break;
54         case Pipe:
55             devStr = "Pipe";
56             break;
57         case Comm:
58             devStr = "Comm";
59             break;
60         default:
61             devStr = "Unknown";
62             break;
63         }
64         return devStr;
65     }
66 }
Popular Tags