Package com.aelitis.azureus.core.cnetwork

Examples of com.aelitis.azureus.core.cnetwork.ContentNetwork


        Debug.out("Tux: UH OH NO CN for " + ds + "\n" + Debug.getCompressedStackTrace());
      }
    } catch (Exception e) {
      Debug.printStackTrace(e);
    }
    ContentNetwork cn = ContentNetworkManagerFactory.getSingleton().getContentNetwork(
        id);
    return cn;
  }
View Full Code Here


              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",
                        "Not in Content Network List").open(null);
                    return;
                  }
                  String url = cn.getTorrentDownloadService(contentHash, "coq");
                  DownloadUrlInfo dlInfo = new DownloadUrlInfoContentNetwork(
                      url, cn);
                  TorrentUIUtilsV3.loadTorrent(dlInfo, false, false, true);
                }
View Full Code Here

        launchUrl(MapUtils.getMapString(decodedMap, "url", null),
            MapUtils.getMapBoolean(decodedMap, "append-suffix", false));
      } else {
        String ref = message.getReferer();
        if (target != null && target.equals("browse") && ref != null) {
          ContentNetwork cn = ContentNetworkManagerFactory.getSingleton().getContentNetworkForURL(
              ref);
          if (cn != null) {
            target = ContentNetworkUtils.getTarget(cn);
            System.err.println("TARGET REWRITTEN TO " + target);
          }
View Full Code Here

      }
    });
  }

  private void launchUrl(String url, boolean appendSuffix) {
    ContentNetwork cn = ContentNetworkUtils.getContentNetworkFromTarget(null);
    if (url.startsWith("/")){
      url = cn.getExternalSiteRelativeURL(url, appendSuffix);
    } else if (appendSuffix) {
      url = cn.appendURLSuffix(url, false, true);
    }
    if (url.startsWith("http://") || url.startsWith("https://")
        || url.startsWith("mailto:")) {
      Utils.launch(url);
    }
View Full Code Here

      if (cnManager == null) {
        showEntryByID(defaultID);
        return;
      }

      ContentNetwork cn = cnManager.getContentNetwork(networkID);
      if (cn == null) {
        showEntryByID(defaultID);
        return;
      }

      if (networkID == ContentNetwork.CONTENT_NETWORK_VUZE) {
        showEntryByID(defaultID);
        cn.setPersistentProperty(ContentNetwork.PP_ACTIVE, Boolean.TRUE);
        return;
      }

      boolean doneAuth = false;
      Object oDoneAuth = cn.getPersistentProperty(ContentNetwork.PP_AUTH_PAGE_SHOWN);
      if (oDoneAuth instanceof Boolean) {
        doneAuth = ((Boolean) oDoneAuth).booleanValue();
      }

      if (!doneAuth && cn.isServiceSupported(ContentNetwork.SERVICE_AUTHORIZE)) {
        if (!AuthorizeWindow.openAuthorizeWindow(cn)) {
          return;
        }
      }
View Full Code Here

        return;
      }

      String hash = DataSourceUtils.getHash(ds);
      if (hash != null) {
        ContentNetwork cn = DataSourceUtils.getContentNetwork(ds);
        if (cn == null) {
          dlInfo = new DownloadUrlInfo(UrlUtils.parseTextForMagnets(hash));
          dlInfo.setReferer(referal);
          TorrentUIUtilsV3.loadTorrent(dlInfo, playNow, false, true);
          return;
        }

        String url = cn.getTorrentDownloadService(hash, referal);
        dlInfo = new DownloadUrlInfoContentNetwork(url, cn);
        TorrentUIUtilsV3.loadTorrent(dlInfo, playNow, false, true);
      }
    }
  }
View Full Code Here

        if (url == null) {
          browser.setText("");
        } else {
          String urlToUse = url;
          if (UrlFilter.getInstance().urlCanRPC(url)){
            ContentNetwork contentNetwork = ContentNetworkManagerFactory.getSingleton().getContentNetwork(
                context.getContentNetworkID());
            if (contentNetwork != null) {
              urlToUse = contentNetwork.appendURLSuffix(urlToUse,
                  false, true);
            }
          }
          if (browser != null) {
            browser.setUrl(urlToUse);
View Full Code Here

    if (image != null && cnImageLoadedListener != null) {
      cnImageLoadedListener.contentNetworkImageLoaded(contentNetworkID, image, true);
      return image;
    }

    ContentNetwork cn = ContentNetworkManagerFactory.getSingleton().getContentNetwork(
        contentNetworkID);
    if (cn == null) {
      return image;
    }
    String imgURL = ContentNetworkUtils.getUrl(cn, ContentNetwork.SERVICE_GET_ICON);
View Full Code Here

        }
      }

      // If it's going to our URLs, add some extra authenication
      if (UrlFilter.getInstance().urlCanRPC(url)) {
        ContentNetwork cn = null;
        if (dlInfo instanceof DownloadUrlInfoContentNetwork) {
          cn = ((DownloadUrlInfoContentNetwork) dlInfo).getContentNetwork();
        }
        if (cn == null) {
          cn = ConstantsVuze.getDefaultContentNetwork();
        }
        url = cn.appendURLSuffix(url, false, true);
      }

      UIFunctionsSWT uiFunctions = (UIFunctionsSWT) UIFunctionsManager.getUIFunctions();
      if (uiFunctions != null) {
        if (!COConfigurationManager.getBooleanParameter("add_torrents_silently")) {
View Full Code Here

      return null;
    }
  }

  public static ContentNetwork getContentNetworkFromTarget(String target) {
    ContentNetwork cn = null;
    if (target != null && target.startsWith("ContentNetwork.")) {
      long networkID = Long.parseLong(target.substring(15));
      cn = ContentNetworkManagerFactory.getSingleton().getContentNetwork(
          networkID);
    }
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.cnetwork.ContentNetwork

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.