コード例 #1
0
  /** @return */
  public static boolean hasFullBurn() {

    PluginInterface pi =
        PluginInitializer.getDefaultInterface().getPluginState().isInitialisationComplete()
            ? AzureusCoreFactory.getSingleton()
                .getPluginManager()
                .getPluginInterfaceByID("azburn_v")
            : null;
    if (pi == null) {
      // maybe not added yet.. use featman
      Set<String> featuresInstalled = UtilitiesImpl.getFeaturesInstalled();
      return featuresInstalled.contains("dvdburn_trial") && !featuresInstalled.contains("dvdburn");
    }
    return pi.getPluginState().isOperational();
  }
コード例 #2
0
ファイル: DeviceImpl.java プロジェクト: aprasa/project
  protected String allocateUniqueFileName(String str) {
    Set<String> name_set = new HashSet<String>();

    for (Map<String, ?> entry : device_files.values()) {

      try {
        name_set.add(
            new File(ImportExportUtils.importString(entry, TranscodeFileImpl.KEY_FILE)).getName());

      } catch (Throwable e) {

        Debug.out(e);
      }
    }

    for (int i = 0; i < 1024; i++) {

      String test_name = i == 0 ? str : (i + "_" + str);

      if (!name_set.contains(test_name)) {

        str = test_name;

        break;
      }
    }

    return (str);
  }
コード例 #3
0
  private void exportParameters() {
    synchronized (exported_parameters) {
      if (!exported_parameters_dirty) {

        return;
      }

      exported_parameters_dirty = false;

      try {
        TreeMap<String, String> tm = new TreeMap<String, String>();

        Set<String> exported_keys = new HashSet<String>();

        for (String[] entry : exported_parameters.values()) {

          String key = entry[0];
          String value = entry[1];

          exported_keys.add(key);

          if (value != null) {

            tm.put(key, value);
          }
        }

        for (Map.Entry<String, String> entry : imported_parameters.entrySet()) {

          String key = entry.getKey();

          if (!exported_keys.contains(key)) {

            tm.put(key, entry.getValue());
          }
        }

        File parent_dir = new File(SystemProperties.getUserPath());

        File props = new File(parent_dir, "exported_params.properties");

        PrintWriter pw =
            new PrintWriter(new OutputStreamWriter(new FileOutputStream(props), "UTF-8"));

        try {
          for (Map.Entry<String, String> entry : tm.entrySet()) {

            pw.println(entry.getKey() + "=" + entry.getValue());
          }

        } finally {

          pw.close();
        }
      } catch (Throwable e) {

        e.printStackTrace();
      }
    }
  }
コード例 #4
0
  protected boolean ignoreFile(String file) {
    if (ignore_set.contains(file.toLowerCase())) {

      report("Torrent.create.progress.ignoringfile", " '" + file + "'");

      return (true);
    }

    return (false);
  }
コード例 #5
0
 public static boolean hasFullLicence() {
   if (featman == null) {
     // Debug.out("featman null");
     Set<String> featuresInstalled = UtilitiesImpl.getFeaturesInstalled();
     return featuresInstalled.contains("dvdburn");
   }
   licenceDetails fullFeatureDetails = getFullFeatureDetails();
   long now = SystemTime.getCurrentTime();
   return fullFeatureDetails != null
       && fullFeatureDetails.expiry > now
       && fullFeatureDetails.displayedExpiry > now;
 }
コード例 #6
0
  protected void fireInitComplete(PluginListener listener) {
    synchronized (init_complete_fired_set) {
      if (init_complete_fired_set.contains(listener)) {

        return;
      }

      init_complete_fired_set.add(listener);
    }

    try {
      listener.initializationComplete();
    } catch (Exception e) {
      Debug.out(e);
    }
  }