Package org.gudy.azureus2.core3.torrent

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


  protected boolean
  setProgressiveMode(
    boolean    active,
    boolean    switching_progressive_downloads )
  {
    TOTorrent  torrent = download_manager.getTorrent();
   
    if ( torrent == null || primary_file == null ){

      return( false );
    }
View Full Code Here


             
              break;
            }
          }
         
          TOTorrent to_torrent = PluginCoreUtils.unwrap( torrent );
         
          if ( public_net && !TorrentUtils.isReallyPrivate( to_torrent )){
           
            DownloadManagerState state = PluginCoreUtils.unwrap( download ).getDownloadState();

            if ( state.getFlag(DownloadManagerState.FLAG_LOW_NOISE )){
             
              continue;
            }
           
            long rand = global_random_id ^ state.getLongParameter( DownloadManagerState.PARAM_RANDOM_SEED );           
           
            long cache = state.getLongAttribute( DownloadManagerState.AT_SCRAPE_CACHE );

            int  seeds_leechers;
           
            if ( cache == -1 ){
             
              seeds_leechers = -1;
             
            }else{
             
              int seeds     = (int)((cache>>32)&0x00ffffff);
              int leechers   = (int)(cache&0x00ffffff);
             
              seeds_leechers   = (int)((seeds<<16)|(leechers&0xffff));
            }

            DownloadInfo info =
              new DownloadInfo(
                hash,
                hash,
                download.getName(),
                (int)rand,
                torrent.isPrivate()?StringInterner.intern(torrent.getAnnounceURL().getHost()):null,
                0,
                false,
                torrent.getSize(),
                (int)( to_torrent.getCreationDate()/(60*60)),
                seeds_leechers,
                (byte)PlatformTorrentUtils.getContentNetworkID( to_torrent ));
           
            new_info.add( info );
           
View Full Code Here

 
  protected void
  pause(
    DownloadManager    dm )
  {
    TOTorrent torrent = dm.getTorrent();
   
    if ( torrent == null ){
     
      return;
    }
   
    try{
      HashWrapper hw = torrent.getHashWrapper();
     
      synchronized( pause_set ){
       
        if ( pause_set.contains( hw )){
         
View Full Code Here

 
  protected void
  resume(
    DownloadManager    dm )
  {
    TOTorrent torrent = dm.getTorrent();
   
    if ( torrent == null ){
     
      return;
    }
   
    try{
      HashWrapper hw = torrent.getHashWrapper();
     
      synchronized( pause_set ){
       
        if ( !pause_set.remove( hw )){
         
View Full Code Here

 
  public EnhancedDownloadManager
  getEnhancedDownload(
    DownloadManager  manager )
  {
    TOTorrent torrent = manager.getTorrent();
   
    if ( torrent == null ){
     
      return( null );
    }
View Full Code Here

    synchronized (download_map) {

      for (Iterator<DownloadManager> iter = download_map.keySet().iterator(); iter.hasNext();) {
        DownloadManager dm = iter.next();

        TOTorrent torrent = dm.getTorrent();
        if (PlatformTorrentUtils.isContent(torrent, true)) {
          String thisHash = PlatformTorrentUtils.getContentHash(torrent);
          if (hash.equals(thisHash)) {
            return dm;
          }
View Full Code Here

    delegate    = _delegate;

    try{
      piece_size = (int)torrent_file.getTorrent().getPieceLength();
     
      TOTorrent  torrent = torrent_file.getTorrent();
     
      long  file_length  = torrent_file.getLength();
     
      long  file_offset_in_torrent = 0;
     
      for (int i=0;i<torrent.getFiles().length;i++){
       
        TOTorrentFile  f = torrent.getFiles()[i];
       
        if ( f == torrent_file ){
         
          break;
        }
View Full Code Here

      ResourceDownloader rd = rdf.create( new URL( url_str ));
   
      InputStream  is = rd.download();
     
      try{   
        TOTorrent  torrent = TOTorrentFactory.deserialiseFromBEncodedInputStream( is );
     
        return( new AzureusPlatformContent( new TorrentImpl( torrent )));
       
      }finally{
       
View Full Code Here

      if ( acf != null ){
       
        return( acf );
      }   
     
      final TOTorrent torrent = ((TorrentImpl)t_torrent).getTorrent();
     
      final DiskManagerFileInfo  file = download.getDiskManagerFileInfo()[index];

      if ( PlatformTorrentUtils.isContent( torrent, false )){
     
View Full Code Here

      DownloadManager          _dm,
      EnhancedDownloadManagerFile    _primary_file )
    {   
      primary_file = _primary_file;
     
      TOTorrent  torrent = download_manager.getTorrent();
           
      content_stream_bps_min = explicit_progressive?content_min_delivery_bps:PlatformTorrentUtils.getContentStreamSpeedBps( torrent );
     
      if ( content_stream_bps_min == 0 ){
     
          // hack in some test values for torrents that don't have a bps in them yet
       
        long  size = torrent.getSize();
       
        if ( size < 200*1024*1024 ){
       
          content_stream_bps_min = 30*1024;
         
 
View Full Code Here

TOP

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

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.