Package org.gudy.azureus2.core3.download.impl

Examples of org.gudy.azureus2.core3.download.impl.DownloadManagerStateImpl$CachedStateWrapper


      updatePiecesInfo(false);     
    }
   
   
   
    DiskManager dm = manager.getDiskManager();
   
    String  remaining;
    String  eta      = DisplayFormatters.formatETA(manager.getStats().getETA());
   
    if ( dm != null ){
     
      long  rem = dm.getRemainingExcludingDND();
     
      String  data_rem = DisplayFormatters.formatByteCountToKiBEtc( rem );
     
      // append data length unless we have an eta value and none left
      
View Full Code Here


        return;
 
      if (piecesImage == null || piecesImage.isDisposed())
        return;
     
      DiskManager  dm = manager.getDiskManager();

      boolean valid = !bForce;
     
        boolean[] new_pieces = new boolean[manager.getNbPieces()];
           
      if ( dm != null ){
                   
          DiskManagerPiece[]  dm_pieces = dm.getPieces();
         
       for (int i=0;i<pieces.length;i++){
              
         new_pieces[i] = dm_pieces[i].isDone();
         }
View Full Code Here

    List<SelectedContent> listSelected = new ArrayList<SelectedContent>(dataSources.length);
    for (Object ds : dataSources) {
      if (ds instanceof DownloadManager) {
        listSelected.add(new SelectedContent((DownloadManager) ds));
      } else if (ds instanceof DiskManagerFileInfo) {
        DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) ds;
        listSelected.add(new SelectedContent(fileInfo.getDownloadManager(), fileInfo.getIndex()));
      }
    }
    SelectedContent[] content = listSelected.toArray(new SelectedContent[0]);
    SelectedContentManager.changeCurrentlySelectedContent(tv.getTableID(), content, tv);
  }
View Full Code Here

    if (dms.length == 0 && dataSources.length > 0) {
      List<DiskManagerFileInfo> listFileInfos = new ArrayList<DiskManagerFileInfo>();
      DownloadManager firstFileDM = null;
      for (Object ds : dataSources) {
        if (ds instanceof DiskManagerFileInfo) {
          DiskManagerFileInfo info = (DiskManagerFileInfo) ds;
          // for now, FilesViewMenuUtil.fillmenu can only handle one DM
          if (firstFileDM != null && !firstFileDM.equals(info.getDownloadManager())) {
            break;
          }
          firstFileDM = info.getDownloadManager();
          listFileInfos.add(info);
        }
      }
      if (listFileInfos.size() > 0) {
        FilesViewMenuUtil.fillMenu(tv, menu, firstFileDM,
View Full Code Here

                    sb.append('\n');
                  } catch (TOTorrentException e) {
                  }
                }
              } else if (ds instanceof DiskManagerFileInfo) {
                DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) ds;
                DownloadManager dm = fileInfo.getDownloadManager();
                TOTorrent torrent = dm.getTorrent();
                if (torrent != null) {
                  try {
                    sb.append(torrent.getHashWrapper().toBase32String());
                    sb.append(';');
                    sb.append(fileInfo.getIndex());
                    sb.append('\n');
                    onlyDMs = false;
                  } catch (TOTorrentException e) {
                  }
                }
View Full Code Here

      if (fileInfos != null) {
        DiskManagerFileInfo[] files = fileInfos.getFiles();
        boolean copied = false;
        int pos = 0;
        for (int i = 0; i < files.length; i++) {
          DiskManagerFileInfo fileInfo = files[i];
          if (fileInfo.isSkipped()
              && (fileInfo.getStorageType() == DiskManagerFileInfo.ST_COMPACT || fileInfo.getStorageType() == DiskManagerFileInfo.ST_REORDER_COMPACT)) {
            continue;
          }
          if (pos != i) {
            if ( !copied ){
                // we *MUSTN'T* modify the returned array!!!!
View Full Code Here

              int  comp_num       = 0;
              int reorder_comp_num  = 0;
             
              for (int iIndex = 0; iIndex < fileInfos.length; iIndex++)
              {
                DiskManagerFileInfo fileInfo = fileInfos[iIndex];
                if (iIndex >= 0 && iIndex < files.length && files[iIndex].lSize == fileInfo.getLength())
                {
                  // Always pull destination file from fileInfo and not from
                  // TorrentFileInfo because the destination may have changed
                  // by magic code elsewhere
                  File fDest = fileInfo.getFile(true);
                  if (files[iIndex].isLinked()){
                 
                    fDest = files[iIndex].getDestFileFullName();
                   
                      // Can't use fileInfo.setLink(fDest) as it renames
                      // the existing file if there is one
                   
                    dm.getDownloadState().setFileLink( fileInfo.getFile(false), fDest);
                  }
                 
                  if (!files[iIndex].bDownload){
                 
                    toSkip[iIndex] = true;
                   
                    if (!fDest.exists()){
                     
                      if ( reorder_mode && ( fileInfo.getLength()/(1024*1024)) >= reorder_mode_min_mb ){
                       
                        toReorderCompact[iIndex] = true;
                       
                        reorder_comp_num++;
                       
View Full Code Here

        return DisplayFormatters.formatETA(dm.getStats().getETA());
      case 'r':
        long to = 0;
        long tot = 0;
        if (dm.getDiskManager() != null) {
          DiskManagerFileInfo files[] = dm.getDiskManager().getFiles();
          if (files != null) {
            if (files.length>1) {
              int c=0;
              for (int i = 0; i < files.length; i++) {
                if (files[i] != null) {
View Full Code Here

      out.println("Status: " + trackerclient.getStatusString());
    } else
      out.println("  Not available");
   
    out.println("- Files Info -");
    DiskManagerFileInfo files[] = dm.getDiskManagerFileInfo();
    if (files != null) {
      for (int i = 0; i < files.length; i++) {
        out.print(((i < 9) ? "   " : "  ") + Integer.toString(i + 1)
            + " (");
        String tmp = ">";
View Full Code Here

    for (int i = datasources.length - 1; i >= 0; i--) {
      if (datasources[i] instanceof DownloadManager) {
        DownloadManager dm = (DownloadManager) datasources[i];
        ManagerUtils.run(dm);
      } else if (datasources[i] instanceof DiskManagerFileInfo) {
        DiskManagerFileInfo info = (DiskManagerFileInfo) datasources[i];
        Utils.launch(info);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.download.impl.DownloadManagerStateImpl$CachedStateWrapper

Copyright © 2018 www.massapicom. 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.