-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVolume.java
More file actions
32 lines (29 loc) · 858 Bytes
/
Copy pathVolume.java
File metadata and controls
32 lines (29 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.io.*;
/**
* To locate inodes and blocks, we need Volume that holds the filesystem, and it is the firs component to be read.
*
*/
public class Volume {
private RandomAccessFile randomAccessFile;
private String fileName;
/**
* Opens the Volume represented by the host Windows/Linux file "filename"
* @param fileName the name of the file
*/
public Volume(String fileName) {
try {
this.fileName = fileName;
randomAccessFile = new RandomAccessFile(fileName, "r");
System.out.println("File has been read successfully!");
}
catch (Exception e) {
e.printStackTrace();
}
}
public RandomAccessFile getRandomAccessFile() {
return randomAccessFile;
}
public String getVolumeName() {
return fileName;
}
}