Reputation: 13
my properties in:
---resources
-------parkSpace.properties
and,I used FileInputStream to read the prpperties:
public static Map<String,String> get(){
InputStream in = new BufferedInputStream(new FileInputStream("parkSpace.properties"));
}
why occurred 'the system cannot find the path'? ths.
Upvotes: 0
Views: 2417
Reputation: 4476
You should get the resource from classloader, using this.getClass().getClassLoader().getResourceAsStream(String name)
instead.
With spring frmework, Spring’s Resource
interface is meant to be a more capable interface for abstracting access to low-level resources.
Reference
Upvotes: 2