Package org.gudy.azureus2.core3.download

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


    byte[] hash = null;
    try {
      hash = torrent.getHash();
    } catch (Exception e) { }

    DownloadManager dm = global_manager.addDownloadManager(
        torrent_file.toString(), hash, data_location.toString(),
        getInitialState(), false);
   
    if ( dm == null ){
     
View Full Code Here


  {
    List  dls = global_manager.getDownloadManagers();

    for (int i=0;i<dls.size();i++){
     
      DownloadManager  man = (DownloadManager)dls.get(i);
     
      if ( man.getDiskManager() == dm ){
       
        return( getDownload( man.getTorrent()));
      }
    }
   
    return( null );
  }
View Full Code Here

 
  public Download
  getDownload(
    byte[]  hash )
  {
    DownloadManager manager = global_manager.getDownloadManager(new HashWrapper(hash));
    if (manager != null) {
      try {
        return getDownload(manager);
      } catch (DownloadException e) {
      }
    }

    List  dls = global_manager.getDownloadManagers();
   
    for (int i=0;i<dls.size();i++){
     
      DownloadManager  man = (DownloadManager)dls.get(i);
     
        // torrent can be null if download manager torrent file read fails
     
      TOTorrent  torrent = man.getTorrent();
     
      if ( torrent != null ){
       
        try{
          if ( Arrays.equals( torrent.getHash(), hash )){
View Full Code Here

     
      piecesImage = new Image(SWTThread.getInstance().getDisplay(), newWidth, newHeight);
      final GC gcImage = new GC(piecesImage);
     
      // dm may be null if this is a skeleton file view
      DownloadManager download_manager = fileInfo.getDownloadManager();
      PEPeerManager peer_manager = download_manager == null ? null : download_manager.getPeerManager();
      PEPiece[] pe_pieces = peer_manager == null ? null : peer_manager.getPieces();
      final long now = SystemTime.getCurrentTime();
     
      if (fileInfo != null && manager != null)
      {
View Full Code Here

    if ( file == null ){
     
      return;
    }
   
    DownloadManager  download_manager = file.getDownloadManager();

    if ( download_manager == null ){
     
      return;
    }
   
    DiskManager    disk_manager = download_manager.getDiskManager();
    PEPeerManager  peer_manager = download_manager.getPeerManager();

    if (disk_manager == null || peer_manager == null ){
     
      return;
    }
View Full Code Here

    if (img != null && !img.isDisposed()) {
      img.dispose();
      img = null;
    }

    DownloadManager  download_manager = file==null?null:file.getDownloadManager();
   
    DiskManager    disk_manager = download_manager==null?null:download_manager.getDiskManager();
    PEPeerManager  peer_manager = download_manager==null?null:download_manager.getPeerManager();
   
    if ( file == null || disk_manager == null || peer_manager == null ) {
      GC gc = new GC(fileInfoCanvas);
      gc.fillRectangle(bounds);
      gc.dispose();
View Full Code Here

      int    value )
    {
      if ( key == MAX_UPLOAD ){
        for (int i=0;i<managers.length;i++){

          DownloadManager  manager = managers[i];
           
          if ( value != manager.getStats().getUploadRateLimitBytesPerSecond()/1024){
           
            manager.getStats().setUploadRateLimitBytesPerSecond(value*1024);
          }
        }
      }else if ( key == MAX_DOWNLOAD ){
        for (int i=0;i<managers.length;i++){

          DownloadManager  manager = managers[i];
           
          if ( value != manager.getStats().getDownloadRateLimitBytesPerSecond()/1024){
           
            manager.getStats().setDownloadRateLimitBytesPerSecond(value*1024);
          }
        }
      }else{
        Debug.out( "Unknown key '" + key + "'" );
      }
View Full Code Here

      String  key,
      int    value )
    {
      for (int i=0;i<managers.length;i++){

        DownloadManager  manager = managers[i];
       
        if ( value != manager.getDownloadState().getIntParameter( key )){
       
          manager.getDownloadState().setIntParameter( key, value );
        }
      }
    } 
View Full Code Here

      String    key,
      boolean    value )
    {
      for (int i=0;i<managers.length;i++){

        DownloadManager  manager = managers[i];
       
        if ( value != manager.getDownloadState().getBooleanParameter( key )){
       
          manager.getDownloadState().setBooleanParameter( key, value );
        }
      }
    }
View Full Code Here

                try {
                  hash = torrent.getHash();
                } catch (TOTorrentException e1) {
                }

                DownloadManager dm = core.getGlobalManager().addDownloadManager(
                    torrent_file.toString(),
                    hash,
                    save_dir.toString(),
                    default_start_stopped ? DownloadManager.STATE_STOPPED
                        : DownloadManager.STATE_QUEUED, true, // persistent
                    true, // for seeding
                    null); // no adapter required

                if (!default_start_stopped && dm != null) {
                  // We want this to move to seeding ASAP, so move it to the top
                  // of the download list, where it will do the quick check and
                  // move to the seeding list
                  // (the for seeding flag should really be smarter and verify
                  //  it's a seeding torrent and set appropriately)
                  dm.getGlobalManager().moveTop(new DownloadManager[] {
                    dm
                  });
                }

                if (_wizard.autoHost
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.download.DownloadManager

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.