I want to load my jops.xml
which includes my JavaPos decives from a custom location. How can I do it?
Asked
Active
Viewed 2,555 times
1

thi gg
- 1,969
- 2
- 22
- 47
-
3possible duplicate of [How to easily load a XML-based Config File into a Java Class?](http://stackoverflow.com/questions/501325/how-to-easily-load-a-xml-based-config-file-into-a-java-class) – brothers28 Jun 17 '15 at 09:56
-
The magic happens with the jpos populator file prop name constant. – thi gg Jun 17 '15 at 11:51
1 Answers
2
You can set it with the JposPropertiesConst.JPOS_POPULATOR_FILE_PROP_NAME
property.
Example how to set it to an env-var:
System.setProperty(JposPropertiesConst.JPOS_POPULATOR_FILE_PROP_NAME, System.getenv("jposxml_path"));

thi gg
- 1,969
- 2
- 22
- 47
-
is it possible to load it with "getResourceAsStream", b/c I want to load it from inside a jar – cp. Jul 01 '15 at 01:09
-
don't know, you can somehow load a jpos file manually. Check the jpostest2 (https://github.com/ntsggr/JavaPOS-POStest-2) tool, maybe you find something in its sourcecode. – thi gg Jul 01 '15 at 12:48