java - Don't find my file.properties -
i try lot of thinks find fail don't know how can it. code is:
//dominiollamadaredsys.java properties d = new properties(); inputstream entrada = null; try { entrada = new fileinputstream("prop/datosapp.properties"); d.load(entrada); system.out.println(d.getproperty("txd.endpointurl")); } catch (ioexception ex) { system.out.println("error: "+ ex.getmessage()); } { if (entrada != null) { try { entrada.close(); } catch (ioexception e) { } } }
i call file inside class in "com.rsi.secpay.dominio" , catch same exception (don't find file), had try quit "prop/" (just "datosapp.properties" ) properties files this:
if prop package in classpath, can stream using classloader:
inputstream = dominiollamadaredsys.class.getresourceasstream("/prop/datosapp.properties");
Comments
Post a Comment