Examples of TorrentImpl


Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

     
      for (int i=0;i<downloads.size();i++){
       
        Download  dl = (Download)downloads.get(i);
       
        TorrentImpl  t = (TorrentImpl)dl.getTorrent();
       
          // can be null if broken torrent
       
        if ( t == null ){
         
          continue;
        }
       
        if ( t.getTorrent().hasSameHashAs( torrent )){
         
          return( dl );
        }
      }
    }
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

 
  public Download
  getDownload(
    Torrent    _torrent )
  {
    TorrentImpl  torrent = (TorrentImpl)_torrent;
   
    try{
      return( getDownload( torrent.getTorrent()));
     
    }catch( DownloadException e ){
    }
   
    return( null );
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

    throws ShareException
  {
    try{
      TOTorrent torrent = TOTorrentFactory.deserialiseFromBEncodedFile( getTorrentFile(item ));
     
      item.setTorrent(new TorrentImpl(torrent));
     
    }catch( TOTorrentException e ){
     
      throw( new ShareException( "ShareManager: Torrent read fails", e ));
    }
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

{
  public static Torrent
  wrap(
    TOTorrent  t )
  {
    return( new TorrentImpl( t ));
  }
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

    TOTorrent  torrent,
    boolean    for_tracker )
 
    throws ClientIDException
  {
    return( getGenerator().generatePeerID( new TorrentImpl( torrent ), for_tracker ));
  }
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

  }
 
  protected Torrent
  getTorrent()
  {
    return( new TorrentImpl( getTOTorrent( false )));
  }
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

     
        //OK lets start the test.
        try{
            TorrentUtils.setFlag( tot, TorrentUtils.TORRENT_FLAG_LOW_NOISE, true );
           
            Torrent torrent = new TorrentImpl(tot);
            String fileName = torrent.getName();

            sendStageUpdateToListeners(MessageText.getString("SpeedTestWizard.stage.message.preparing"));
             
            //create a blank file of specified size. (using the temporary name.)
            File saveLocation = AETemporaryFileHandler.createTempFile();
            File baseDir = saveLocation.getParentFile();
            File blankFile = new File(baseDir,fileName);
            File blankTorrentFile = new File( baseDir, "speedTestTorrent.torrent" );
            torrent.writeToFile(blankTorrentFile);

            URL  announce_url = torrent.getAnnounceURL();
           
            if ( announce_url.getProtocol().equalsIgnoreCase( "https" )){
             
              SESecurityManager.setCertificateHandler(
                  announce_url,
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

                 
                  ResourceDownloader mr_rd = rdf.getMetaRefreshDownloader( url_rd );
   
                  InputStream is = mr_rd.download();
   
                  Torrent torrent = new TorrentImpl( TOTorrentFactory.deserialiseFromBEncodedInputStream( is ));
                           
                  // PlatformTorrentUtils.setContentTitle(torrent, torr );
             
                  DownloadManager dm = PluginInitializer.getDefaultInterface().getDownloadManager();
                 
                  Download  download;
                 
                  boolean auto_start = manager.shouldAutoStart( torrent );
                 
                  if ( auto_start ){
                 
                    download = dm.addDownload( torrent );
                   
                  }else{
                 
                    download = dm.addDownloadStopped( torrent, null, null );
                  }
                 
                  log( subs.getName() + ": added download " + download.getName()+ ": auto-start=" + auto_start );

                  subs.addAssociation( torrent.getHash());
                 
                  result.setRead( true );
                                   
                  if ( tried_ref_switch ){
                   
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

         
            // PlatformTorrentUtils.setContentThumbnail(torrent, thumbnail);
           
          TorrentUtils.setFlag( torrent, TorrentUtils.TORRENT_FLAG_LOW_NOISE, true );
         
          Torrent t = new TorrentImpl( torrent );
         
          t.setDefaultEncoding();
         
          t.writeToFile( torrent_file );
         
          download = dm.addDownload( t, torrent_file, data_file );
         
          download.setFlag( Download.FLAG_DISABLE_AUTO_FILE_MOVE, true );
View Full Code Here

Examples of org.gudy.azureus2.pluginsimpl.local.torrent.TorrentImpl

      InputStream  is = rd.download();
     
      try{   
        TOTorrent  torrent = TOTorrentFactory.deserialiseFromBEncodedInputStream( is );
     
        return( new AzureusPlatformContent( new TorrentImpl( torrent )));
       
      }finally{
       
        is.close();
      }
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.