-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileTest.java
56 lines (48 loc) · 1.54 KB
/
FileTest.java
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
public class FileTest {
public static void main(String[] args) {
File settings = new File("Settings", 10);
File ringtone = new File("rubgtone", 120);
File family = new File("family", 201);
File portrait = new File("portrait", 134);
File wallpaper = new File("wallpaper", 421);
File test = new File("test", 10);
File familyTest = new File("family", 1);
File familyTwo = new File("family", 1);
Directory root = new Directory("root");
Directory music = new Directory("music");
Directory pictures = new Directory("pictures");
Directory personal = new Directory("personal");
Directory misc = new Directory("misc");
Directory test2 = new Directory("test2");
root.add(settings);
root.add(music);
root.add(pictures);
music.add(ringtone);
pictures.add(personal);
pictures.add(misc);
personal.add(family);
personal.add(portrait);
misc.add(wallpaper);
misc.add(test);
misc.remove(test);
misc.add(test2);
test2.add(familyTest);
misc.remove(test2);
misc.add(familyTwo);
System.out.println(root.display("+-"));
boolean t = false;
if(root.search("settings") == null) {
t = true;
}
boolean p = false;
if(root.search("misc") == null) {
p = true;
}
System.out.println(t);
System.out.println(p);
System.out.println(root.search("Settings").getName());
System.out.println(root.search("family").getName());
System.out.println(root.search("wallpaper").getName());
System.out.println(root.search("misc").getName());
}
}