Esempio n. 1
0
  private void saveFavorite(Renderer r) {

    Properties prop = new Properties();
    prop.setProperty("protocol", r.getProtocol());
    prop.setProperty("identifier", r.getIdentifier());
    prop.setProperty("name", r.getName());
    try {
      File f = new File(Global.FAVORIS, prop.getProperty("identifier"));
      if (!f.exists()) f.createNewFile();
      FileOutputStream out = new FileOutputStream(f);
      prop.store(out, null);
      out.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Esempio n. 2
0
 public boolean isFavorite(Renderer r) {
   boolean res = false;
   File[] files = Global.FAVORIS.listFiles();
   for (int i = 0; i < files.length && !res; i++) {
     if (r.getIdentifier().equals(files[i].getName())) res = true;
   }
   return res;
 }
Esempio n. 3
0
 private void deleteFavorite(Renderer r) {
   File f = new File(Global.FAVORIS, r.getIdentifier());
   f.delete();
 }