-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee_Remove.java
More file actions
37 lines (32 loc) · 1021 Bytes
/
Employee_Remove.java
File metadata and controls
37 lines (32 loc) · 1021 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
33
34
35
36
37
import java.io.File;
import java.io.IOException;
class Employee_Remove implements FileFunctions {
@Override
public void createFileBaseHTML() throws IOException {
// Not implemented
}
@Override
public void listUserdataFiles() throws IOException {
// Not implemented
}
public void removeFile(String id) {
File file = new File(FileFunctions.USER_DATA_DIR+"employee" + id + ".html");
if (file.exists()) {
if (file.delete()) {
System.out.println("\nEmployee has been removed successfully!");
} else {
System.out.println("\nFailed to remove employee.");
}
} else {
System.out.println("\nEmployee does not exist!");
}
}
@Override
public void viewFile(String id) throws IOException {
// Not implemented
}
@Override
public void updateFile(String id, String oldData, String newData) throws IOException {
// Not implemented
}
}