コード例 #1
0
  @Override
  public void onDownloadControllerUpdatedData(FilePackage pkg, FilePackageProperty property) {

    if (property != null) {
      HashMap<String, Object> dls = null;
      // [DATA_UPDATE.extractionStatus, DATA_UPDATE.finished, DATA_UPDATE.priority,
      // DATA_UPDATE.speed, DATA_UPDATE.url,
      // DATA_UPDATE.enabled, DATA_UPDATE.skipped, DATA_UPDATE.running, DATA_UPDATE.bytesLoaded,
      // DATA_UPDATE.eta,
      // DATA_UPDATE.maxResults, DATA_UPDATE.packageUUIDs, DATA_UPDATE.host, DATA_UPDATE.comment,
      // DATA_UPDATE.bytesTotal,
      // DATA_UPDATE.startAt, DATA_UPDATE.status]

      switch (property.getProperty()) {
        case COMMENT:
          dls = new HashMap<String, Object>();
          dls.put("uuid", pkg.getUniqueID().getID());
          dls.put("comment", pkg.getComment());
          fire(
              BASIC_EVENT.PACKAGE_UPDATE,
              FilePackageProperty.Property.COMMENT.toString(),
              dls,
              pkg.getUniqueID());
          break;
        case FOLDER:
          break;
        case NAME:
          dls = new HashMap<String, Object>();
          dls.put("uuid", pkg.getUniqueID().getID());
          dls.put("name", pkg.getName());
          fire(
              BASIC_EVENT.PACKAGE_UPDATE.name() + ".name",
              dls,
              BASIC_EVENT.PACKAGE_UPDATE.name() + ".name." + pkg.getUniqueID().getID());
          break;
        case PRIORITY:
          dls = new HashMap<String, Object>();
          dls.put("uuid", pkg.getUniqueID().getID());
          dls.put(
              "priority",
              org.jdownloader.myjdownloader.client.bindings.PriorityStorable.valueOf(
                  pkg.getPriorityEnum().name()));
          fire(
              BASIC_EVENT.PACKAGE_UPDATE.name() + ".priority",
              dls,
              BASIC_EVENT.PACKAGE_UPDATE.name() + ".priority." + pkg.getUniqueID().getID());
      }
    }

    fire(BASIC_EVENT.REFRESH_CONTENT.name(), null, BASIC_EVENT.REFRESH_CONTENT.name());
    flushBuffer();
  }
コード例 #2
0
 public String getName() {
   return filePackage.getName();
 }