I am having issue with loading
test.xml and test.properties
inside the same folder conf.
I have a myProject.jar inside dist folder and
test.xml and test.properties inside conf folder.
To load xml, I am using
document = reader.read(new File("../conf/test.xml"));//its working
But I am having issue when loading properties file,
I am using
Class_name.class.getResourceAsStream("../conf/test.properties"),
getResourceAsStream("conf/test.properties"),
getResourceAsStream("/test.properties"),
getResourceAsStream("test.properties"),
Nothing is working for properties file.
Any help is appreciated.
Why don’t you take the file and load it using an
FileInputStreamThe above code will take the properties file and load it into a properties object.