No3x
Mitglied
Hi! Ich hab leider ein Problem beim Abspeichern meiner properties:
Laden funktioniert direkt innerhalb der jar aber wie speicher ich sie nun wieder ab?
Ich dachte mir so:
Aber dann bekomm ich einen Fehler:
No suitable constructor found for FileOutputStream(java.io.InputStream)
Hat jemand eine Idee?
Laden funktioniert direkt innerhalb der jar aber wie speicher ich sie nun wieder ab?
Code:
Properties prop = null;
try {
InputStream is = UploaderApp.class.getResourceAsStream("/uploader/resources/UploaderSettingsBox.properties");
if(is != null) {
prop = new Properties();
prop.load(is);
prop.list(System.out);
prop.setProperty("bla", "blub");
FileOutputStream Fos = new FileOutputStream(is);
prop.store(Fos, null);
} else {
System.out.println("ERROR: Could not find properties file.");
}
} catch (Exception e) {
System.out.println(e.getMessage());
}
Code:
FileOutputStream Fos = new FileOutputStream(is);
prop.store(Fos, null);
No suitable constructor found for FileOutputStream(java.io.InputStream)
Hat jemand eine Idee?