Skip to content

Commit 1ecdf62

Browse files
committed
Tweak implementation
1 parent d9df9e6 commit 1ecdf62

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

src/main/java/com/nordstrom/common/file/VolumeInfo.java

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,35 +53,28 @@ public static Map<String, VolumeProps> getVolumeProps() throws IOException {
5353

5454
public static class VolumeProps {
5555

56-
String spec; // block device or remote file system
57-
String file; // file system mount point
58-
String type; // file system type
59-
String[] opts; // file system mount options
56+
String file;
57+
String type;
58+
String[] opts;
6059

6160
private long size;
6261
private long free;
6362

6463
VolumeProps(String spec, String file, String type, String... opts) {
65-
this.spec = spec;
66-
this.file = file;
67-
this.type = type;
68-
this.opts = opts;
69-
70-
File f;
7164
if (IS_WINDOWS) {
72-
f = new File(spec);
65+
this.file = spec;
7366
} else {
74-
f = new File(file);
67+
this.file = file;
7568
}
7669

70+
this.type = type;
71+
this.opts = opts;
72+
73+
File f = new File(this.file);
7774
this.size = f.getTotalSpace();
7875
this.free = f.getFreeSpace();
7976
}
8077

81-
public String getSpec() {
82-
return spec;
83-
}
84-
8578
public String getFile() {
8679
return file;
8780
}

src/test/java/com/nordstrom/common/file/VolumeInfoTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ public class VolumeInfoTest {
1313
public void test() throws IOException {
1414
Map<String, VolumeProps> propsList = VolumeInfo.getVolumeProps();
1515
for (VolumeProps thisProps : propsList.values()) {
16-
System.out.println("spec: " + thisProps.getSpec());
1716
System.out.println("file: " + thisProps.getFile());
1817
System.out.println("type: " + thisProps.getType());
1918
System.out.println("opts: " + String.join(",", thisProps.getOpts()));

0 commit comments

Comments
 (0)