Code example for Properties

Methods: load, remove, store

0
            proprietes = getPropertiesInput();
        } catch (FileNotFoundException ex) {
        } 
        if (proprietes != null) {
            delete(proprietes, i);
            proprietes.store(cordova.getContext().openFileOutput(SETTINGS_FILE, Context.MODE_PRIVATE), "Configuration Strangers");
        } 
    } 
 
    private void delete(Properties proprietes, int i) throws GeneralSecurityException, JSONException {
        proprietes.remove("account_" + i + ".id");
        proprietes.remove("account_" + i + ".mail");
        proprietes.remove("account_" + i + ".user");
        proprietes.remove("account_" + i + ".pass");
        proprietes.remove("account_" + i + ".serv");
        proprietes.remove("account_" + i + ".port");
        proprietes.remove("account_" + i + ".ssl");
        proprietes.remove("account_" + i + ".boxes");
    } 
 
    private Properties getPropertiesInput() throws FileNotFoundException, IOException {
        Properties proprietes = new Properties();
        proprietes.load(cordova.getContext().openFileInput(SETTINGS_FILE));
        return proprietes;
    } 
}