![]() | ![]() |
|||||||||||
![]() | ![]() |
|||||||||||
| Home | ![]() | Greetings | ![]() | Hobby | ![]() | Travel | ![]() | Contact | ![]() | ? | ||
|
The Problem: I wanted to read a property file from the classpath. The Solution: A property file called test.properties in the classpath.
URL url = ClassLoader.getSystemResource("test.properties");
Properties p = new Properties();
p.load(new FileInputStream(new File(url.getFile())));
System.out.println(p.getProperty("my.property"));
|
||||||||||||
| Home | ![]() | Greetings | ![]() | Hobby | ![]() | Travel | ![]() | Contact | ![]() | ? | ||