Package org.gudy.azureus2.core3.torrent

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


   * @return
   *
   * @since 3.0.5.3
   */
  public static boolean isPlatformContent(Object ds) {
    TOTorrent torrent = getTorrent(ds);
    if (torrent != null) {
      return PlatformTorrentUtils.isContent(torrent, true);
    }
    if ((ds instanceof VuzeActivitiesEntry)
        && ((VuzeActivitiesEntry) ds).isPlatformContent()) {
View Full Code Here


  private static boolean canPlay(DownloadManager dm, int file_index) {
    if (dm == null) {
      return false;
    }
    TOTorrent torrent = dm.getTorrent();
    return canUseEMP(torrent,file_index);
  }
View Full Code Here

 
    DownloadManager dm = DataSourceUtils.getDM(ds);
    if (dm != null) {
      return canPlay(dm, file_index);
    }
    TOTorrent torrent = DataSourceUtils.getTorrent(ds);
    if (torrent != null) {
      return canPlay(torrent, file_index);
    }
    if (ds instanceof VuzeActivitiesEntry) {
      return ((VuzeActivitiesEntry) ds).isPlayable();
View Full Code Here

    if ( !StreamManager.getSingleton().isStreamingUsable()){
     
      return( false );
    }
   
    TOTorrent torrent = dm.getTorrent();
       
    return( canUseEMP( torrent, file_index, false ));
  }
View Full Code Here

          if (e.character == 15 && e.stateMask == (SWT.SHIFT | SWT.CONTROL)) {
            Object[] selectedDataSources = tv.getSelectedDataSources().toArray();
            for (int i = 0; i < selectedDataSources.length; i++) {
              DownloadManager dm = (DownloadManager) selectedDataSources[i];
              if (dm != null) {
                TOTorrent torrent = dm.getTorrent();
                String contentHash = PlatformTorrentUtils.getContentHash(torrent);
                if (contentHash != null && contentHash.length() > 0) {
                  ContentNetwork cn = DataSourceUtils.getContentNetwork(torrent);
                  if (cn == null) {
                    new MessageBoxShell(SWT.OK, "coq",
View Full Code Here

      tempTorrentFile = File.createTempFile("AZU", ".torrent");
      tempTorrentFile.deleteOnExit();
      String filename = tempTorrentFile.getAbsolutePath();
      FileUtil.writeBytesAsFile(filename, decodedTorrent);

      TOTorrent torrent = TorrentUtils.readFromFile(tempTorrentFile, false);
      // Security: Only allow torrents from whitelisted trackers
      if (!PlatformTorrentUtils.isPlatformTracker(torrent)) {
        Debug.out("stopped loading torrent because it's not in whitelist");
        return false;
      }
View Full Code Here

   
    DownloadManager[] dms = SelectedContentManager.getDMSFromSelectedContent();
    for (DownloadManager dm : dms) {
      if (dm != null) {
        Map<String, Object> mapDM = new HashMap<String, Object>();
        TOTorrent torrent = dm.getTorrent();
        if (torrent != null && !TorrentUtils.isReallyPrivate(torrent)) {
          try {
            // make a copy of the torrent
 
            Map torrent_map = torrent.serialiseToMap();
            TOTorrent torrent_to_send = TOTorrentFactory.deserialiseFromMap( torrent_map );
            Map  vuze_map = (Map)torrent_map.get( "vuze" );
            // remove any non-standard stuff (e.g. resume data)
            torrent_to_send.removeAdditionalProperties();
            torrent_map = torrent_to_send.serialiseToMap();
            if ( vuze_map != null ){
              torrent_map.put( "vuze", vuze_map );
            }
           
            byte[] encode = BEncoder.encode(torrent_map);
View Full Code Here

    }
  }

  public static void downloadDataSource(Object ds, boolean playNow,
      String referal) {
    TOTorrent torrent = DataSourceUtils.getTorrent(ds);
   
      // handle encapsulated vuze file
    try{
      Map torrent_map = torrent.serialiseToMap();
     
      torrent_map.remove( "info" );
     
      VuzeFile vf = VuzeFileHandler.getSingleton().loadVuzeFile( torrent_map );
   
View Full Code Here

    //    if (!canPlay(dm)) {
    //      return false;
    //    }

    final TOTorrent torrent = dm.getTorrent();
    if (torrent == null) {
      return;
    }
    if (PlayUtils.canUseEMP(torrent, file_index,complete_only)) {
      debug("Can use EMP");
View Full Code Here

  public static void playViaMediaServer(Download download, int file_index ) {

    try {
      final DownloadManager dm = ((DownloadImpl) download).getDownload();

      TOTorrent torrent = dm.getTorrent();
      runFile(torrent, file_index, PlayUtils.getContentUrl(dm), true);
    } catch (Throwable e) {
      Logger.log(new LogEvent(LogIDs.UI3, "IPC to media server plugin failed",
          e));
    }
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.