code: public void savePreferences() {
          FOKLogger.info(Prefs.class.getName(), "Saving preference file as: " + file.getAbsolutePath());
          if (!file.getParentFile().exists() && !file.getParentFile().mkdirs())
              throw new IllegalStateException("Unable to create the folder to save the Prefs in");
  
          try (FileOutputStream out = new FileOutputStream(file)){
              props.store(out, "This is a preference file of the app " + Common.getInstance().getAppName() + ". If you delete this file, the specified app will be (partly or entirely) reset to its factory settings.");
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
docs: Saves the properties file to the hard disk. No need to call this method explicitly as it is already called every time {@link #setPreference(String, String)} is called.