Exemplo n.º 1
0
  public static boolean canStreamDS(Object ds, int file_index) {
    if (!(Constants.isWindows || Constants.isOSX)) {

      return (false);
    }

    if (ds == null) {

      return (false);
    }

    if (ds instanceof org.gudy.azureus2.core3.disk.DiskManagerFileInfo) {
      org.gudy.azureus2.core3.disk.DiskManagerFileInfo fi =
          (org.gudy.azureus2.core3.disk.DiskManagerFileInfo) ds;
      return canStreamDS(fi.getDownloadManager(), fi.getIndex());
    }

    DownloadManager dm = DataSourceUtils.getDM(ds);

    if (dm != null) {

      return (canStream(dm, file_index));
    }

    return (false);
  }
Exemplo n.º 2
0
  public static boolean canPlayDS(Object ds, int file_index) {

    if (!(Constants.isWindows || Constants.isOSX)) {

      return (false);
    }

    if (ds == null) {
      return false;
    }

    if (ds instanceof org.gudy.azureus2.core3.disk.DiskManagerFileInfo) {
      org.gudy.azureus2.core3.disk.DiskManagerFileInfo fi =
          (org.gudy.azureus2.core3.disk.DiskManagerFileInfo) ds;
      return canPlayDS(fi.getDownloadManager(), fi.getIndex());
    }

    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();
    }

    if (ds instanceof SelectedContentV3) {
      SelectedContentV3 sel = (SelectedContentV3) ds;
      return sel.canPlay();
    }

    return false;
  }
Exemplo n.º 3
0
 @Before
 public void setUp() {
   dataSource = DataSourceUtils.createLocal();
   dbUtils = new DbUtils(dataSource);
 }