forked from CourseRepository/SeleniumWebdriverWithJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassLoader.java
More file actions
37 lines (31 loc) · 865 Bytes
/
classLoader.java
File metadata and controls
37 lines (31 loc) · 865 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
package testcase;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
* @author - rahul.rathore
* @date - 16-Nov-2014
*/
public class classLoader {
public static void main(String[] args) {
String path = classLoader.class.getClassLoader().getResource("./").getPath();
path = path.replaceAll("bin", "src");
// System.out.println(path);
File f = new File(path + "../test-output/testng-results.xml");
try {
FileInputStream fin = new FileInputStream(f);
byte buf[] = new byte[1024];
fin.read(buf);
String s = new String(buf);
System.out.println(s);
fin.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}