|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 package com.nokia.s60tools.hticonnection.services; |
|
19 |
|
20 /** |
|
21 * Contains information of disk drive |
|
22 */ |
|
23 public class DriveInfo { |
|
24 |
|
25 |
|
26 /** |
|
27 * The root path of the drive |
|
28 */ |
|
29 private String rootPath; |
|
30 |
|
31 /** |
|
32 * The name of the drive |
|
33 */ |
|
34 private String name; |
|
35 |
|
36 /** |
|
37 * The type of media |
|
38 */ |
|
39 private MediaType type; |
|
40 |
|
41 /** |
|
42 * Unique identifier number of the drive |
|
43 */ |
|
44 private long uid; |
|
45 |
|
46 /** |
|
47 * The total size of the drive in bytes |
|
48 */ |
|
49 private long size; |
|
50 |
|
51 /** |
|
52 * Free space on the drive in bytes |
|
53 */ |
|
54 private long freeSpace; |
|
55 |
|
56 /** |
|
57 * Media type of drive |
|
58 */ |
|
59 public enum MediaType { |
|
60 NOT_PRESET, |
|
61 UNKNOWN, |
|
62 FLOPPY, |
|
63 HARD_DISK, |
|
64 CDROM, |
|
65 RAM, |
|
66 FLASH, |
|
67 ROM, |
|
68 REMOTE, |
|
69 NAND_FLASH, |
|
70 ROTATING_MEDIA |
|
71 }; |
|
72 |
|
73 /** |
|
74 * Constructor |
|
75 */ |
|
76 public DriveInfo() { |
|
77 |
|
78 } |
|
79 |
|
80 |
|
81 /** |
|
82 * Constructor |
|
83 * @param rootPath The root path of the drive |
|
84 * @param name The name of the drive |
|
85 * @param type The type of media |
|
86 * @param uid Unique identifier number of the drive |
|
87 * @param size The total size of the drive in bytes |
|
88 * @param freeSpace Free space on the drive in bytes |
|
89 */ |
|
90 public DriveInfo(String rootPath, String name, MediaType type, long uid, long size, long freeSpace) { |
|
91 this.rootPath = rootPath; |
|
92 this.name = name; |
|
93 this.type = type; |
|
94 this.uid = uid; |
|
95 this.size = size; |
|
96 this.freeSpace = freeSpace; |
|
97 } |
|
98 |
|
99 /** |
|
100 * Get root path of the drive |
|
101 * @return The root path of the drive |
|
102 */ |
|
103 public String getRootPath() { |
|
104 return rootPath; |
|
105 } |
|
106 |
|
107 /** |
|
108 * Set root path of the drive |
|
109 * @param rootPath The root path of the drive |
|
110 */ |
|
111 public void setRootPath(String rootPath) { |
|
112 this.rootPath = rootPath; |
|
113 } |
|
114 |
|
115 /** |
|
116 * Get the name of the drive |
|
117 * @return The name of the drive |
|
118 */ |
|
119 public String getName() { |
|
120 return name; |
|
121 } |
|
122 |
|
123 /** |
|
124 * Set the name of the drive |
|
125 * @param name The name of the drive |
|
126 */ |
|
127 public void setName(String name) { |
|
128 this.name = name; |
|
129 } |
|
130 |
|
131 /** |
|
132 * Get the type of media |
|
133 * @return The type of media |
|
134 */ |
|
135 public MediaType getType() { |
|
136 return type; |
|
137 } |
|
138 |
|
139 /** |
|
140 * Set the type of media |
|
141 * @param type The type of media |
|
142 */ |
|
143 public void setType(MediaType type) { |
|
144 this.type = type; |
|
145 } |
|
146 |
|
147 /** |
|
148 * Get unique identifier number of the drive |
|
149 * @return Unique identifier number of the drive |
|
150 */ |
|
151 public long getUid() { |
|
152 return uid; |
|
153 } |
|
154 |
|
155 /** |
|
156 * Set unique identifier number of the drive |
|
157 * @param uid Unique identifier number of the drive |
|
158 */ |
|
159 public void setUid(long uid) { |
|
160 this.uid = uid; |
|
161 } |
|
162 |
|
163 /** |
|
164 * Get the total size of the drive in bytes |
|
165 * @return The total size of the drive in bytes |
|
166 */ |
|
167 public long getSize() { |
|
168 return size; |
|
169 } |
|
170 |
|
171 /** |
|
172 * Set the total size of the drive in bytes |
|
173 * @param size The total size of the drive in bytes |
|
174 */ |
|
175 public void setSize(long size) { |
|
176 this.size = size; |
|
177 } |
|
178 |
|
179 /** |
|
180 * Get free space on the drive in bytes |
|
181 * @return Free space on the drive in bytes |
|
182 */ |
|
183 public long getFreeSpace() { |
|
184 return freeSpace; |
|
185 } |
|
186 |
|
187 /** |
|
188 * Set free space on the drive in bytes |
|
189 * @param freeSpace Free space on the drive in bytes |
|
190 */ |
|
191 public void setFreeSpace(long freeSpace) { |
|
192 this.freeSpace = freeSpace; |
|
193 } |
|
194 |
|
195 } |