-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGitTester.java
More file actions
56 lines (44 loc) · 1.61 KB
/
GitTester.java
File metadata and controls
56 lines (44 loc) · 1.61 KB
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
import java.io.*;
import java.util.*;
public class GitTester {
public static void main (String [] args) throws IOException {
Git git = new Git();
Blob blob = new Blob ("test.txt");
File index = new File ("git/index");
FileWriter indexWriter = new FileWriter("git/index");
indexWriter.write("hello");
indexWriter.close();
if (index.exists())
{
index.delete();
}
index.createNewFile();
System.out.println("Testing tree");
File file = new File ("testForTree");
file.mkdir();
try {
FileWriter writer = new FileWriter("testForTree/test2.txt");
writer.write("Big C in the house one");
writer.close();
System.out.println("Testing directory inside a directory");
File file2 = new File ("testForTree/testForTree2");
file2.mkdir();
FileWriter writer2 = new FileWriter("testForTree/test3.txt");
writer2.write("Test 2 bro");
writer2.close();
} catch (IOException e) {
e.printStackTrace();
}
Blob treeBlob = new Blob ("testForTree");
// System.out.println ("Testing non existent file");
// try {
// Blob nonExistentBlob = new Blob ("nonExistentFile.txt");
// } catch (FileNotFoundException e) {
// System.out.println("Test passed");
// }
//creating a directory inside a directory
//delete git
//System.out.println("Deleting git");
//git.deleteGit();
}
}