मुझे अपने आवेदन में कुछ गुण फ़ाइल जोड़ने की आवश्यकता है। मैंने इस फ़ाइल को controller
निर्देशिका में जोड़ा है, लेकिन उन्हें लोड नहीं कर सकता (क्लासपाथ में नहीं?) - InputStream
शून्य है। इस फ़ाइल को कहां रखा जा सकता है?संसाधन कहां रखा जाए?
public class Application extends Controller {
static {
try {
Properties p = new Properties();
InputStream in = Application.class.getClassLoader().getResourceAsStream("accounts.properties");
if(in != null) {
p.load(in);
in.close();
} else {
error("null inputstream");
}
} catch (Exception e) {
e.printStackTrace();
}
}
// Actions below
// ...
}
'sbt' के नए संस्करणों के साथ, आप लिखेंगे: 'Compile + में resourceDirectories + = baseDirectory.value /" myresources "' –