View Javadoc
1   /**
2    * Oshi (https://github.com/dblock/oshi)
3    * 
4    * Copyright (c) 2010 - 2015 The Oshi Project Team
5    * 
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Eclipse Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/epl-v10.html
10   * 
11   * Contributors:
12   * dblock[at]dblock[dot]org
13   * alessandro[at]perucchi[dot]org
14   * widdis[at]gmail[dot]com
15   * https://github.com/dblock/oshi/graphs/contributors
16   */
17  package oshi.software.os;
18  
19  /**
20   * The File System is a storage pool, device, partition, volume, concrete file
21   * system or other implementation specific means of file storage. See subclasses
22   * for definitions as they apply to specific platforms.
23   * 
24   * @author widdis[at]gmail[dot]com
25   */
26  public class OSFileStore {
27  	private String name;
28  
29  	private String description;
30  
31  	private long usableSpace;
32  
33  	private long totalSpace;
34  
35  	/**
36  	 * Creates a {@link OSFileStore} with the specified parameters.
37  	 * 
38  	 * @param name
39  	 * @param description
40  	 * @param usableSpace
41  	 * @param totalSpace
42  	 */
43  	public OSFileStore(String name, String description, long usableSpace,
44  			long totalSpace) {
45  		this.setName(name);
46  		this.setDescription(description);
47  		this.setUsableSpace(usableSpace);
48  		this.setTotalSpace(totalSpace);
49  	}
50  
51  	/**
52  	 * Name of the File System
53  	 * 
54  	 * @return The file system name
55  	 */
56  	public String getName() {
57  		return this.name;
58  	}
59  
60  	/**
61  	 * Sets the File System name
62  	 * 
63  	 * @param name
64  	 *            The name
65  	 */
66  	public void setName(String name) {
67  		this.name = name;
68  	}
69  
70  	/**
71  	 * Description of the File System
72  	 * 
73  	 * @return The file system description
74  	 */
75  	public String getDescription() {
76  		return this.description;
77  	}
78  
79  	/**
80  	 * Sets the File System description
81  	 * 
82  	 * @param description
83  	 *            The description
84  	 */
85  	public void setDescription(String description) {
86  		this.description = description;
87  	}
88  
89  	/**
90  	 * Usable space on the drive.
91  	 * 
92  	 * @return Usable space on the drive (in bytes)
93  	 */
94  	public long getUsableSpace() {
95  		return this.usableSpace;
96  	}
97  
98  	/**
99  	 * Sets usable space on the drive.
100 	 * 
101 	 * @param usableSpace
102 	 *            Bytes of writable space.
103 	 */
104 	public void setUsableSpace(long usableSpace) {
105 		this.usableSpace = usableSpace;
106 	}
107 
108 	/**
109 	 * Total space/capacity of the drive.
110 	 * 
111 	 * @return Total capacity of the drive (in bytes)
112 	 */
113 	public long getTotalSpace() {
114 		return this.totalSpace;
115 	}
116 
117 	/**
118 	 * Sets the total space on the drive.
119 	 * 
120 	 * @param totalSpace
121 	 *            Bytes of total space.
122 	 */
123 	public void setTotalSpace(long totalSpace) {
124 		this.totalSpace = totalSpace;
125 	}
126 }