@Override public Preferences getPreferences (String name) { File libraryPath = new File(System.getenv("HOME"), "Library"); File finalPath = new File(libraryPath, name + ".plist"); String path = libraryPath + "/" + name + ".plist"; NSMutableDictionary<String, Object> nsDictionary = NSMutableDictionary.dictionaryWithContentsOfFile(path); // if it fails to get an existing dictionary, create a new one. if (nsDictionary == null) { nsDictionary = (NSMutableDictionary<String, Object>)NSMutableDictionary.alloc().init(); nsDictionary.writeToFileAtomically(path, false); } return new IOSPreferences(nsDictionary, finalPath.getAbsolutePath()); }
@Override public Preferences getPreferences (String name) { File libraryPath = new File(System.getenv("HOME"), "Library"); File finalPath = new File(libraryPath, name + ".plist"); String path = libraryPath + "/" + name + ".plist"; NSMutableDictionary<String, Object> nsDictionary = NSMutableDictionary.dictionaryWithContentsOfFile(path); // if it fails to get an existing dictionary, create a new one. if (nsDictionary == null) { nsDictionary = (NSMutableDictionary<String, Object>)NSMutableDictionary.alloc().init(); nsDictionary.writeToFileAtomically(path, false); } return new IOSPreferences(nsDictionary, finalPath.getAbsolutePath()); }
@Override public Preferences getPreferences (String name) { File libraryPath = new File(System.getenv("HOME"), "Library"); File finalPath = new File(libraryPath, name + ".plist"); String path = libraryPath + "/" + name + ".plist"; NSMutableDictionary<String, Object> nsDictionary = NSMutableDictionary.dictionaryWithContentsOfFile(path); // if it fails to get an existing dictionary, create a new one. if (nsDictionary == null) { nsDictionary = (NSMutableDictionary<String, Object>)NSMutableDictionary.alloc().init(); nsDictionary.writeToFileAtomically(path, false); } return new IOSPreferences(nsDictionary, finalPath.getAbsolutePath()); }