Package org.gudy.azureus2.core3.torrent

Examples of org.gudy.azureus2.core3.torrent.TOTorrentAnnounceURLSet


        boolean  found_decentralised = false;
        boolean  modified      = false;
       
        for ( int i=0;i<sets.length;i++ ){
         
          TOTorrentAnnounceURLSet set = sets[i];
         
          URL[] urls = set.getAnnounceURLs().clone();
         
          for (int j=0;j<urls.length;j++){
           
            URL u = urls[j];
           
            if ( u != null && TorrentUtils.isDecentralised( u )){
                           
              if ( found_decentralised ){
               
                modified = true;
               
                urls[j] = null;
               
              }else{
               
                found_decentralised = true;
              }
            }
          }
        }
       
        if ( modified ){
         
          List<TOTorrentAnnounceURLSet> s_list = new ArrayList<TOTorrentAnnounceURLSet>();
         
          for ( TOTorrentAnnounceURLSet set: sets ){
           
            URL[] urls = set.getAnnounceURLs();
           
            List<URL> u_list = new ArrayList<URL>( urls.length );
           
            for ( URL u: urls ){
             
              if ( u != null ){
               
                u_list.add( u );
              }
            }
           
            if ( u_list.size() > 0 ){
             
              s_list.add( torrent.getAnnounceURLGroup().createAnnounceURLSet( u_list.toArray( new URL[ u_list.size() ])));
            }
          }
         
          sets = s_list.toArray( new TOTorrentAnnounceURLSet[ s_list.size() ]);
        }
      }
     
      List<TOTorrentAnnounceURLSet[]>  new_sets = new ArrayList<TOTorrentAnnounceURLSet[]>();
     
      if ( is_manual || sets.length < 2 ){
         
        new_sets.add( sets );
       
      }else{
       
        List<TOTorrentAnnounceURLSet> list = new ArrayList<TOTorrentAnnounceURLSet>( Arrays.asList( sets ));
       
          // often we have http:/xxxx/ and udp:/xxxx/ as separate groups - keep these together
               
        while( list.size() > 0 ){
         
          TOTorrentAnnounceURLSet set1 = list.remove(0);
         
          boolean  done = false;
         
          URL[] urls1 = set1.getAnnounceURLs();
         
          if ( urls1.length == 1 ){
           
            URL url1 = urls1[0];
           
            String prot1 = url1.getProtocol().toLowerCase();
            String host1  = url1.getHost();
           
            for (int i=0;i<list.size();i++){
             
              TOTorrentAnnounceURLSet set2 = list.get(i);
             
              URL[] urls2 = set2.getAnnounceURLs();
             
              if ( urls2.length == 1 ){
               
                URL url2 = urls2[0];
               
View Full Code Here


       
        Random  scrape_random = new Random(scrape_random_seed);
       
        for (int i=0;response==null && i<sets.length;i++){
         
          TOTorrentAnnounceURLSet  set = sets[i];
         
          URL[]  urls = set.getAnnounceURLs();
         
          List  rand_urls = new ArrayList();
                    
          for (int j=0;j<urls.length;j++ ){
           
View Full Code Here

    out.println("Torrent Filename: " + dm.getTorrentFileName());
    out.println("Saving to: " + dm.getSaveLocation());
    out.println("Created By: " + dm.getTorrentCreatedBy());
    out.println("Comment: " + dm.getTorrentComment());
    out.println("- Tracker Info -");
    TRTrackerAnnouncer trackerclient = dm.getTrackerClient();
    if (trackerclient != null) {
      out.println("URL: " + trackerclient.getTrackerURL());
      String timestr;
      try {
        int time = trackerclient.getTimeUntilNextUpdate();
        if (time < 0) {
          timestr = MessageText.getString("GeneralView.label.updatein.querying");
        } else {
          int minutes = time / 60;
          int seconds = time % 60;
          String strSeconds = "" + seconds;
          if (seconds < 10) {
            strSeconds = "0" + seconds; //$NON-NLS-1$
          }
          timestr = minutes + ":" + strSeconds;
        }
      } catch (Exception e) {
        timestr = "unknown";
      }
      out.println("Time till next Update: " + timestr);
      out.println("Status: " + trackerclient.getStatusString());
    } else
      out.println("  Not available");
   
    out.println("- Files Info -");
    DiskManagerFileInfo files[] = dm.getDiskManagerFileInfo();
View Full Code Here

          return "";
        return "(max " + DisplayFormatters.formatByteCountToKiBEtcPerSec(uploadSpeed) + ")";
       
      case 'S':
      case 'P':
        TRTrackerScraperResponse hd = dm.getTrackerScrapeResponse();
        if (hd == null || !hd.isValid())
          return "?";
        else
        {
          if( variable == 'S' )
            return Integer.toString(hd.getSeeds());
          else
            return Integer.toString(hd.getPeers());
        }
      default:
        return "??" + variable + "??";
    }
  }
View Full Code Here

  protected boolean performCommand(ConsoleInput ci, DownloadManager dm, List args) {
    TOTorrent torrent = dm.getTorrent();
        if (torrent != null) {
          try {
          TRHost  host = ci.azureus_core.getTrackerHost();
         
          TRHostTorrent  existing = host.getHostTorrent( torrent );
         
          if ( existing == null ){
           
            host.publishTorrent(torrent);
          }else{
            try{
              existing.remove();
             
            }catch( Throwable e ){
View Full Code Here

    TOTorrent torrent = dm.getTorrent();
        if (torrent != null) {
          try {
          TRHost  host = ci.azureus_core.getTrackerHost();
         
          TRHostTorrent  existing = host.getHostTorrent( torrent );
         
          if ( existing == null ){
           
            host.publishTorrent(torrent);
          }else{
            try{
              existing.remove();
             
            }catch( Throwable e ){
             
              e.printStackTrace();
            }
View Full Code Here

    }
   
    final trustDialog[]  dialog = new trustDialog[1];
   
    try{
      Utils.execSWTThread(new AERunnable() {
            public void
            runSupport()
            {
              dialog[0] = new trustDialog( display, resource, cert );
            }
View Full Code Here

      return;
    }
   
    try{
      display.asyncExec(
          new AERunnable()
          {
            public void
            runSupport()
            {
               new createDialog( display );
View Full Code Here

    if (logAlert.details != null) {
      text += "\n<A HREF=\"details\">" + MessageText.getString("v3.MainWindow.button.viewdetails") + "</A>";
    }

    Utils.execSWTThread(new AERunnable() {
      public void runSupport() {
        openWindow();
      }
    });
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ui.IStartup#earlyStartup()
   */
  public void earlyStartup() {
    final Display display = Display.getDefault();
    display.syncExec(new AERunnable() {
      public void runSupport() {
        hookApplicationMenu(display);
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.torrent.TOTorrentAnnounceURLSet

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.