Package org.gudy.azureus2.plugins.torrent

Examples of org.gudy.azureus2.plugins.torrent.Torrent


     
      return( 0 );
    }
   
    try{
      Torrent t = manager.getDownload().getTorrent();
     
      if ( t == null ){
       
        return( Long.MAX_VALUE );
      }
     
      return(( t.getSize() * rem_pm ) / 1000 );
     
    }catch( Throwable e ){
     
      return( Long.MAX_VALUE );
    }
View Full Code Here


      // if this didn't work then nothing much else will so just fall through
     
      return;
    }
   
    Torrent t = dl.getTorrent();
   
    if ( t != null ){
     
      if TorrentUtils.isReallyPrivate( PluginCoreUtils.unwrap( t ))){
       
View Full Code Here

  public ExternalSeedReader[]
   getSeedReaders(
     ExternalSeedPlugin    plugin,
     Download        download )
  {   
    Torrent  torrent = download.getTorrent();
   
    try{
      Map  config = new HashMap();
     
      Object  obj = torrent.getAdditionalProperty( "httpseeds" );
     
      if ( obj != null ){
       
        config.put( "httpseeds", obj );
      }
View Full Code Here

    getSeedReaders(
      ExternalSeedPlugin    plugin,
      Download        download,
      Map            config )
  {   
    Torrent  torrent = download.getTorrent();
   
    try{
      Object  obj = config.get( "httpseeds" );
     
        // might as well handle case where there's a single entry rather than a list
View Full Code Here

      reply.put( "type", new Long( RT_AZ2_REPLY_MESSAGE ));

    }else if type == RT_AZ2_REQUEST_SEND_TORRENT ){
     
      try{
        final Torrent  torrent = plugin.getPluginInterface().getTorrentManager().createFromBEncodedData((byte[])request.get( "torrent" ));
     
        new AEThread2( "torrentAdder", true )
        {
          public void
          run()
          {
            PluginInterface pi = plugin.getPluginInterface();
           
            String msg = pi.getUtilities().getLocaleUtilities().getLocalisedMessageText(
                "azbuddy.addtorrent.msg",
                new String[]{ from_buddy.getName(), torrent.getName() });
           
            long res = pi.getUIManager().showMessageBox(
                    "azbuddy.addtorrent.title",
                    "!" + msg + "!",
                    UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
View Full Code Here

 
  public void
  downloadAdded(
    final Download  download )
  {
    Torrent t = download.getTorrent();
   
    if ( t == null ){
     
      return;
    }
   
    if ( t.isPrivate()){
     
      download.addTrackerListener(
        new DownloadTrackerListener()
        {
          public void
View Full Code Here

 
  protected boolean
  okToTrack(
    Download  d )
  {
    Torrent  t = d.getTorrent();
   
    if ( t == null ){
     
      return( false );
    }
   
      // only track private torrents if we have successfully received peers from tracker
      // which means we have the torrent legitimately. As this rule is enforced by both
      // ends of the tracking operation it means we will only track between peers that
      // both have a legitimate copy of the torrent.
       
    if ( t.isPrivate()){
     
      DownloadAnnounceResult announce = d.getLastAnnounceResult();

      if (   announce == null ||
          announce.getResponseType() != DownloadAnnounceResult.RT_SUCCESS ||
View Full Code Here

   
    protected
    downloadData(
      Download  download )
    {
      Torrent t = download.getTorrent();
     
      if ( t != null ){
       
        byte[]  hash = t.getHash();
       
        SHA1  sha1 = new SHA1();
     
        sha1.update( ByteBuffer.wrap( IV ));
        sha1.update( ByteBuffer.wrap( hash ));
View Full Code Here

  public ExternalSeedReader[]
     getSeedReaders(
       ExternalSeedPlugin    plugin,
       Download        download )
    {   
      Torrent  torrent = download.getTorrent();
     
      try{
        Map  config = new HashMap();
       
        Object  obj = torrent.getAdditionalProperty( "url-list" );
       
        if ( obj != null ){
         
          config.put( "url-list", obj );
        }
       
       obj = torrent.getAdditionalProperty( "url-list-params" );
       
        if ( obj != null ){
         
          config.put( "url-list-params", obj );
        }
       
      obj = torrent.getAdditionalProperty( "url-list-params2" );
       
        if ( obj != null ){
         
          config.put( "url-list-params2", obj );
        }
View Full Code Here

             
              return;
            }
          }
         
          Torrent torrent = download.getTorrent();
         
          if ( torrent != null && !TorrentUtils.isReallyPrivate( PluginCoreUtils.unwrap( torrent ))){
           
            torrents.add( torrent );
          }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.torrent.Torrent

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.