File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
sources/net.sf.j2s.java.core/src/test Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 11package test ;
22
3+ import java .io .BufferedReader ;
34import java .io .File ;
45import java .io .FileOutputStream ;
6+ import java .io .FileReader ;
57import java .io .IOException ;
68import java .io .OutputStream ;
9+ import java .net .URL ;
710import java .util .Properties ;
811
912public class Test_Resource extends Test_ {
@@ -15,8 +18,17 @@ static int getInt() {
1518 static boolean isClosed = false ;
1619
1720 public static void main (String [] args ) {
21+
1822 Properties p = new Properties ();
1923 try {
24+
25+
26+ URL url = Test_Resource .class .getResource ("test.properties" );
27+ File file = new File (url .toURI ());
28+ BufferedReader fr = new BufferedReader (new FileReader (file ));
29+ System .out .println (fr .readLine ());
30+ fr .close ();
31+ System .out .println ("URItest OK" );
2032 // check for proper referencing of an interface
2133 Class <?> c = Test_Resource .class ;
2234 System .out .println ("Class.getResourceAsStream(\" test.properties\" )" );
You can’t perform that action at this time.
0 commit comments