Example #1
0
  @Override
  public void removeInformation(Information info) {
    // this.infoFolder.remove(this.getInfoFoldername());
    super.removeInformation(info);

    FSInformation fsinfo = (FSInformation) info;

    FSSharkKB.removeFSStorage(fsinfo.getPath());

    this.infoFolder.remove(fsinfo.getPath());
    if (this.information.isEmpty()) {
      File file = new File(getCPFildername() + "/.sharkfw_st_systemProperties");
      file.delete();
    } else {
      this.persist();
    }
  }
Example #2
0
  @Override
  public FSInformation addInformation() {
    FSPropertyHolder fsph = FSSharkKB.createFSPropertyHolder(this.getInfoFoldername());

    FSInformation newInfo = null;
    try {
      newInfo = new FSInformation(fsph);
    } catch (SharkKBException ex) {
      L.w("couldn't restore information from file", this);
    }
    super.putInformation(newInfo);

    // remember folder
    this.infoFolder.add(fsph.getFolderName());

    newInfo.persist();
    this.persist();

    return newInfo;
  }