예제 #1
0
 /**
  * @param hash base32
  * @return true if this is one of our friend's files (i.e., we haven't started a download, but we
  *     want to show in the UI)
  */
 public boolean isF2FHash(String hash) {
   if (hash.startsWith(OneSwarmConstants.BITTORRENT_MAGNET_PREFIX)) {
     hash = hash.substring(OneSwarmConstants.BITTORRENT_MAGNET_PREFIX.length());
   }
   org.gudy.azureus2.core3.download.DownloadManager dm =
       AzureusCoreImpl.getSingleton()
           .getGlobalManager()
           .getDownloadManager(new HashWrapper(Base32.decode(hash)));
   return dm == null; // == null -> we don't have it -> f2f.
 }
예제 #2
0
 public Download getDownload(String torrentID) {
   if (torrentID.startsWith(OneSwarmConstants.BITTORRENT_MAGNET_PREFIX)) {
     torrentID = torrentID.substring(OneSwarmConstants.BITTORRENT_MAGNET_PREFIX.length());
     byte[] torrentHash = Base32.decode(torrentID);
     try {
       return pluginInterface.getDownloadManager().getDownload(torrentHash);
     } catch (DownloadException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
   return null;
 }