Package org.gudy.azureus2.core3.disk.impl.access

Examples of org.gudy.azureus2.core3.disk.impl.access.DMChecker


  private static DiskManagerFileInfo[] toDMFI(Object[] objects) {
    int count = 0;
    DiskManagerFileInfo[] result = new DiskManagerFileInfo[objects.length];
    for (Object object : objects) {
      if (object instanceof DiskManagerFileInfo) {
        DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) object;
        result[count++] = fileInfo;
      } else if (object instanceof SelectedContent) {
        SelectedContent sc = (SelectedContent) object;
        int fileIndex = sc.getFileIndex();
        if (fileIndex >= 0 && sc.getDownloadManager() != null) {
View Full Code Here


              canStop = true;
            }
          } else {
            DiskManagerFileInfo[] fileInfos = dm.getDiskManagerFileInfo();
            if (fileIndex < fileInfos.length) {
              DiskManagerFileInfo fileInfo = fileInfos[fileIndex];
              if (!canStart && (fileInfo.isSkipped())) {
                canStart = true;
              }
             
              if (!canStop && !fileInfo.isSkipped()) {
                canStop = true;
              }
             
              if (!canRemoveFileInfo && !fileInfo.isSkipped()) {
                int storageType = fileInfo.getStorageType();
                if (storageType == DiskManagerFileInfo.ST_LINEAR
                    || storageType == DiskManagerFileInfo.ST_COMPACT) {
                  canRemoveFileInfo = true;
                }
              }
             
              if (!canRunFileInfo
                  && fileInfo.getAccessMode() == DiskManagerFileInfo.READ
                  && fileInfo.getDownloaded() == fileInfo.getLength()
                  && fileInfo.getFile(true).exists()) {
                canRunFileInfo = true;
              }
            }
          }
        }
View Full Code Here

    DownloadManager dm = (DownloadManager) ds;
    if (rowCore.getSubItemCount() == 0 && dm.getTorrent() != null
        && !dm.getTorrent().isSimpleTorrent() && rowCore.isVisible()
        && dm.getNumFileInfos() > 0) {
      DiskManagerFileInfoSet fileInfos = dm.getDiskManagerFileInfoSet();
      if (fileInfos != null) {
        DiskManagerFileInfo[] files = fileInfos.getFiles();
        boolean copied = false;
        int pos = 0;
        for (int i = 0; i < files.length; i++) {
          DiskManagerFileInfo fileInfo = files[i];
          if (fileInfo.isSkipped()
View Full Code Here

  public static DiskManager
  create(
    TOTorrent    torrent,
    DownloadManager manager)
  {
    DiskManagerImpl dm = new DiskManagerImpl( torrent, manager );
   
    if ( dm.getState() != DiskManager.FAULTY ){
     
      dm.start();
    }
   
    return dm;
  }
View Full Code Here

  public DiskManagerCheckRequest
  createCheckRequest(
    int     pieceNumber,
    Object    user_data )
  {
    DMChecker  checker = getChecker();
   
    return( checker.createCheckRequest( pieceNumber, user_data));
  }
View Full Code Here

  public void
  enqueueCheckRequest(
    DiskManagerCheckRequest      request,
    DiskManagerCheckRequestListener  listener )
  {
    DMChecker  checker = getChecker();

    checker.enqueueCheckRequest( request, listener );
  }
View Full Code Here

   
 
  protected DMChecker
  getChecker()
  {
    DMChecker  checker = checker_use_accessor;
   
    if ( checker == null ){
     
      checker = checker_use_accessor = DMAccessFactory.createChecker( this );
    }
View Full Code Here

        }
        CategoryManager.addCategoryManagerListener(MyTorrentsView.this);
        globalManager.addListener(MyTorrentsView.this, false);
        DownloadManager[] dms = (DownloadManager[]) globalManager.getDownloadManagers().toArray(new DownloadManager[0]);
        for (int i = 0; i < dms.length; i++) {
          DownloadManager dm = dms[i];
          dm.addListener(MyTorrentsView.this);
          if (!isOurDownloadManager(dm)) {
            dms[i] = null;
          }
        }
        tv.addDataSources(dms);
View Full Code Here

        }
      }
    });
    Object[] dms = globalManager.getDownloadManagers().toArray();
    for (int i = 0; i < dms.length; i++) {
      DownloadManager dm = (DownloadManager) dms[i];
      dm.removeListener(this);
    }
    if (currentCategory != null) {
      currentCategory.removeCategoryListener(this);
    }
    CategoryManager.removeCategoryManagerListener(this);
View Full Code Here

          long ttlSize = 0;
          long ttlRSpeed = 0;
          long ttlSSpeed = 0;
          int count = 0;
          for (Iterator iter = dms.iterator(); iter.hasNext();) {
            DownloadManager dm = (DownloadManager) iter.next();

            if (!isInCategory(dm, currentCategory))
              continue;

            count++;
            if (dm.getState() == DownloadManager.STATE_DOWNLOADING
                || dm.getState() == DownloadManager.STATE_SEEDING)
              ttlActive++;
            ttlSize += dm.getSize();
            ttlRSpeed += dm.getStats().getDataReceiveRate();
            ttlSSpeed += dm.getStats().getDataSendRate();
          }

          String up_details = "";
          String down_details = "";
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.disk.impl.access.DMChecker

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.