private void save() {
      File file = getCacheFile();

      file.getParentFile().mkdirs();

      System.out.println("Writing cache: " + file);

      FileUtil.writeResilientFile(file, contents);

      dirty = false;
    }
Beispiel #2
0
  protected void saveDeviceFile() {
    device_files_dirty = false;

    try {
      loadDeviceFile();

      if (device_files == null || device_files.size() == 0) {

        FileUtil.deleteResilientFile(getDeviceFile());

      } else {
        Map map = new HashMap();

        map.put("files", device_files);

        FileUtil.writeResilientFile(getDeviceFile(), map);
      }
    } catch (Throwable e) {

      Debug.out("Failed to save device file", e);
    }
  }