You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.0 KiB
32 lines
1.0 KiB
package com.fr.plugin.sso.test; |
|
|
|
import com.fr.io.utils.ResourceIOUtils; |
|
|
|
import java.io.BufferedReader; |
|
import java.io.FileInputStream; |
|
import java.io.InputStream; |
|
import java.io.InputStreamReader; |
|
import java.util.Properties; |
|
|
|
public class Test { |
|
public static void main(String[] args) { |
|
Properties p = new Properties(); |
|
// try{ |
|
// String path = Test.class.getClass().getResource("/").getPath();//得到工程名WEB-INF/classes/路径 |
|
// path=path.substring(1, path.indexOf("classes"));//从路径字符串中取出工程路径 |
|
// p.load(new FileInputStream(path+"wz.properties")); |
|
// }catch(Exception e){ |
|
// e.printStackTrace(); |
|
// } |
|
|
|
try{ |
|
InputStream is = ResourceIOUtils.read("/resources/wz.properties"); |
|
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is)); |
|
p.load(bufferedReader); |
|
}catch(Exception e){ |
|
e.printStackTrace(); |
|
} |
|
|
|
System.out.println(); |
|
} |
|
}
|
|
|