Examples of DownloadManager


Examples of org.gudy.azureus2.core3.download.DownloadManager

        result[count++] = fileInfo;
      } else if (object instanceof SelectedContent) {
        SelectedContent sc = (SelectedContent) object;
        int fileIndex = sc.getFileIndex();
        if (fileIndex >= 0 && sc.getDownloadManager() != null) {
          DownloadManager dm = sc.getDownloadManager();
          if (dm != null) {
            DiskManagerFileInfo[] infos = dm.getDiskManagerFileInfo();
            if (fileIndex < infos.length) {
              result[count++] = infos[fileIndex];
            }
          }
        }
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

      boolean hasDM = false;
 
      if (currentContent.length > 0 && hasRealDM) {
        for (int i = 0; i < currentContent.length; i++) {
          ISelectedContent content = currentContent[i];
          DownloadManager dm = content.getDownloadManager();
          int fileIndex = content.getFileIndex();
          if (fileIndex == -1) {
            hasDM = true;
            if (!canStart && ManagerUtils.isStartable(dm)) {
              canStart = true;
            }
            if (!canStop && ManagerUtils.isStopable(dm)) {
              canStop = true;
            }
          } else {
            DiskManagerFileInfo[] fileInfos = dm.getDiskManagerFileInfo();
            if (fileIndex < fileInfos.length) {
              DiskManagerFileInfo fileInfo = fileInfos[fileIndex];
              if (!canStart && (fileInfo.isSkipped())) {
                canStart = true;
              }
             
              if (!canStop && !fileInfo.isSkipped()) {
                canStop = true;
              }
             
              if (!canRemoveFileInfo && !fileInfo.isSkipped()) {
                int storageType = fileInfo.getStorageType();
                if (storageType == DiskManagerFileInfo.ST_LINEAR
                    || storageType == DiskManagerFileInfo.ST_COMPACT) {
                  canRemoveFileInfo = true;
                }
              }
             
              if (!canRunFileInfo
                  && fileInfo.getAccessMode() == DiskManagerFileInfo.READ
                  && fileInfo.getDownloaded() == fileInfo.getLength()
                  && fileInfo.getFile(true).exists()) {
                canRunFileInfo = true;
              }
            }
          }
        }
        boolean canRemove = hasDM || canRemoveFileInfo;
        mapNewToolbarStates.put("remove", canRemove);
      }
 
      boolean canRun = has1Selection && ((hasDM && !canRunFileInfo) || (!hasDM && canRunFileInfo));
      if (canRun) {
        ISelectedContent content = currentContent[0];
        DownloadManager dm = content.getDownloadManager();
 
        if (dm == null) {
          canRun = false;
        } else {
          TOTorrent torrent = dm.getTorrent();
 
          if (torrent == null) {
 
            canRun = false;
 
          } else if (!dm.getAssumedComplete() && torrent.isSimpleTorrent()) {
 
            canRun = false;
  /*
          } else if (PlatformTorrentUtils.useEMP(torrent)
              && PlatformTorrentUtils.embeddedPlayerAvail()
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

    // chose to act on all, we do immediately all and quit. 
    // If the user chose an action just for the one torrent, we do that action,
    // remove that item from the array (by nulling it), and then call
    // removeDownloads again so we can prompt again (or erase more published/low noise torrents)
    for (int i = 0; i < dms.length; i++) {
      DownloadManager dm = dms[i];
      if (dm == null) {
        continue;
      }

      boolean deleteTorrent = COConfigurationManager.getBooleanParameter("def.deletetorrent");

      int confirm = COConfigurationManager.getIntParameter("tb.confirm.delete.content");
      boolean doPrompt = confirm == 0 | forcePrompt;

      if (doPrompt) {
        String title = MessageText.getString("deletedata.title");
        String text = MessageText.getString("v3.deleteContent.message",
            new String[] {
              dm.getDisplayName()
            });

        String[] buttons;
        int[] buttonVals;
        int defaultButtonPos;
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

    }
    if (doAll) {
      if (result == 1 || result == 2) {

        for (int i = index; i < dms.length; i++) {
          DownloadManager dm = dms[i];
          boolean deleteData = result == 2 ? false
              : !dm.getDownloadState().getFlag(
                  Download.FLAG_DO_NOT_DELETE_DATA_ON_REMOVE);
          ManagerUtils.asyncStopDelete(dm, DownloadManager.STATE_STOPPED,
              deleteTorrent, deleteData, deleteFailed);
        }
      } //else cancel
    } else { // not remembered
      if (result == 1 || result == 2) {
        DownloadManager dm = dms[index];
        boolean deleteData = result == 2 ? false
            : !dm.getDownloadState().getFlag(
                Download.FLAG_DO_NOT_DELETE_DATA_ON_REMOVE);

        ManagerUtils.asyncStopDelete(dm, DownloadManager.STATE_STOPPED,
            deleteTorrent, deleteData, null);
      }
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

    StringBuffer toolTip = new StringBuffer();
    String separator = ""; //$NON-NLS-1$
    try{
      managers_mon.enter();
      for (int i = 0; i < managers.size(); i++) {
        DownloadManager manager = (DownloadManager) managers.get(i);
    DownloadManagerStats  stats = manager.getStats();
   
        String name = manager.getDisplayName();
        String completed = DisplayFormatters.formatPercentFromThousands(stats.getCompleted());
        toolTip.append(separator);
        toolTip.append(name);
        toolTip.append(" -- C: ");
        toolTip.append(completed);
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

    DiskManagerFileInfo[] file_infos = new DiskManagerFileInfo[datasources.length];
    for (int i = 0; i < datasources.length; i++) {
      file_infos[i] = (DiskManagerFileInfo) datasources[i];

      DownloadManager dm = file_infos[i].getDownloadManager();
      ArrayList<DiskManagerFileInfo> listFileInfos = mapDMtoDMFI.get(dm);
      if (listFileInfos == null) {
        listFileInfos = new ArrayList<DiskManagerFileInfo>(1);
        mapDMtoDMFI.put(dm, listFileInfos);
      }
      listFileInfos.add(file_infos[i]);

      if (type == PRIORITY_NORMAL || type == PRIORITY_HIGH) {
        file_infos[i].setPriority(type == PRIORITY_HIGH ? 1 : 0);
      }
    }
    boolean skipped = (type == PRIORITY_SKIPPED || type == PRIORITY_DELETE);
    boolean delete_action = (type == PRIORITY_DELETE);
    for (DownloadManager dm : mapDMtoDMFI.keySet()) {
      ArrayList<DiskManagerFileInfo> list = mapDMtoDMFI.get(dm);
      DiskManagerFileInfo[] fileInfos = list.toArray(new DiskManagerFileInfo[0]);
      boolean paused = setSkipped(dm, fileInfos, skipped, delete_action);

      if (paused) {

        dm.resume();
      }
    }
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

          DiskManagerFileInfo[] file_infos = new DiskManagerFileInfo[datasources.length];
          for (int i = 0; i < datasources.length; i++) {
            file_infos[i] = (DiskManagerFileInfo) datasources[i];

            DownloadManager dm = file_infos[i].getDownloadManager();
            ArrayList<DiskManagerFileInfo> listFileInfos = mapDMtoDMFI.get(dm);
            if (listFileInfos == null) {
              listFileInfos = new ArrayList<DiskManagerFileInfo>(1);
              mapDMtoDMFI.put(dm, listFileInfos);
            }
            listFileInfos.add(file_infos[i]);

            file_infos[i].setPriority(priority);
          }

          for (DownloadManager dm : mapDMtoDMFI.keySet()) {
            ArrayList<DiskManagerFileInfo> list = mapDMtoDMFI.get(dm);
            DiskManagerFileInfo[] fileInfos = list.toArray(new DiskManagerFileInfo[0]);
            boolean paused = setSkipped(dm, fileInfos, false, false);

            if (paused) {

              dm.resume();
            }
          }

        }
      }
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

            totalSegmentsLengths += l;
          }
        }

        int maxMatches = 0;
        DownloadManager match = null;
        for (Iterator iter = downloadManagers.iterator(); iter.hasNext();) {
          DownloadManager dm = (DownloadManager) iter.next();

          if (dm.getState() == DownloadManager.STATE_ERROR) {
            continue;
          }

          int numMatches = 0;

          String dmName = dm.getDisplayName().toLowerCase();

          for (int x = 0; x < segments.length; x++) {
            String[] segmentArray = segments[x];
            for (int i = 0; i < segmentArray.length; i++) {
              int l = segmentArray[i].length();
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

    if (torrent == null)
      return;
    CoreWaiterSWT.waitForCoreRunning(new AzureusCoreRunningListener() {
   
      public void azureusCoreRunning(AzureusCore core) {
        DownloadManager dm = core.getGlobalManager().getDownloadManager(
            torrent.getTorrent());
        if (dm != null) {
          UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
          if (uiFunctions != null) {
            uiFunctions.openView(UIFunctions.VIEW_DM_DETAILS, dm);
View Full Code Here

Examples of org.gudy.azureus2.core3.download.DownloadManager

       
      TRHostTorrent  tr_torrent = (TRHostTorrent)row.getDataSource(true);
   
    final TOTorrent  torrent = tr_torrent.getTorrent();
   
    DownloadManager dm = core.getGlobalManager().getDownloadManager( torrent );

    if ( dm != null ){
     
      dm.getDownloadState().setCategory( category );
     
    }else{
     
         String cat_str;
         
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.