Package org.gudy.azureus2.core3.disk

Examples of org.gudy.azureus2.core3.disk.DiskManagerFileInfo


      Category[] categories = CategoryManager.getCategories();
      Arrays.sort(categories);

      if (categories.length > 0) {
        Category catUncat = CategoryManager.getCategory(Category.TYPE_UNCATEGORIZED);
        if (catUncat != null) {
          final MenuItem itemCategory = new MenuItem(menuCategory, SWT.PUSH);
          Messages.setLanguageText(itemCategory, catUncat.getName());
          itemCategory.setData("Category", catUncat);
          itemCategory.addListener(SWT.Selection, new Listener() {
            public void handleEvent(Event event) {
              MenuItem item = (MenuItem)event.widget;
              assignSelectedToCategory((Category)item.getData("Category"));
View Full Code Here


    }
 
    private void addCategory() {
      CategoryAdderWindow adderWindow = new CategoryAdderWindow(Display.getDefault());
      Category newCategory = adderWindow.getNewCategory();
      if (newCategory != null)
        assignSelectedToCategory(newCategory);
    }
View Full Code Here

              String configAutoKey = TransferSpeedValidator.getActiveAutoUploadParameter(globalManager);

              COConfigurationManager.setParameter(configAutoKey, false);
            }

            final int cValue = ((Integer) new TransferSpeedValidator(configKey,
                new Integer(newSpeed)).getValue()).intValue();

            COConfigurationManager.setParameter(configKey, cValue);

            COConfigurationManager.save();
View Full Code Here

                              TransferSpeedValidator.getActiveAutoUploadParameter(globalManager);
              
                            COConfigurationManager.setParameter( configAutoKey, false );
                          }
                         
                          final int cValue = ((Integer)new TransferSpeedValidator(configKey, (Number)items[i].getData("maxkb")).getValue()).intValue();
                          COConfigurationManager.setParameter(configKey, cValue);
                         

                          COConfigurationManager.save();
                      }
View Full Code Here

    List<SelectedContent> listSelected = new ArrayList<SelectedContent>(dataSources.length);
    for (Object ds : dataSources) {
      if (ds instanceof DownloadManager) {
        listSelected.add(new SelectedContent((DownloadManager) ds));
      } else if (ds instanceof DiskManagerFileInfo) {
        DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) ds;
        listSelected.add(new SelectedContent(fileInfo.getDownloadManager(), fileInfo.getIndex()));
      }
    }
    SelectedContent[] content = listSelected.toArray(new SelectedContent[0]);
    SelectedContentManager.changeCurrentlySelectedContent(tv.getTableID(), content, tv);
  }
View Full Code Here

    if (dms.length == 0 && dataSources.length > 0) {
      List<DiskManagerFileInfo> listFileInfos = new ArrayList<DiskManagerFileInfo>();
      DownloadManager firstFileDM = null;
      for (Object ds : dataSources) {
        if (ds instanceof DiskManagerFileInfo) {
          DiskManagerFileInfo info = (DiskManagerFileInfo) ds;
          // for now, FilesViewMenuUtil.fillmenu can only handle one DM
          if (firstFileDM != null && !firstFileDM.equals(info.getDownloadManager())) {
            break;
          }
          firstFileDM = info.getDownloadManager();
          listFileInfos.add(info);
        }
      }
      if (listFileInfos.size() > 0) {
        FilesViewMenuUtil.fillMenu(tv, menu, firstFileDM,
View Full Code Here

                    sb.append('\n');
                  } catch (TOTorrentException e) {
                  }
                }
              } else if (ds instanceof DiskManagerFileInfo) {
                DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) ds;
                DownloadManager dm = fileInfo.getDownloadManager();
                TOTorrent torrent = dm.getTorrent();
                if (torrent != null) {
                  try {
                    sb.append(torrent.getHashWrapper().toBase32String());
                    sb.append(';');
                    sb.append(fileInfo.getIndex());
                    sb.append('\n');
                    onlyDMs = false;
                  } catch (TOTorrentException e) {
                  }
                }
View Full Code Here

      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()
              && (fileInfo.getStorageType() == DiskManagerFileInfo.ST_COMPACT || fileInfo.getStorageType() == DiskManagerFileInfo.ST_REORDER_COMPACT)) {
            continue;
          }
          if (pos != i) {
            if ( !copied ){
                // we *MUSTN'T* modify the returned array!!!!
View Full Code Here

              int  comp_num       = 0;
              int reorder_comp_num  = 0;
             
              for (int iIndex = 0; iIndex < fileInfos.length; iIndex++)
              {
                DiskManagerFileInfo fileInfo = fileInfos[iIndex];
                if (iIndex >= 0 && iIndex < files.length && files[iIndex].lSize == fileInfo.getLength())
                {
                  // Always pull destination file from fileInfo and not from
                  // TorrentFileInfo because the destination may have changed
                  // by magic code elsewhere
                  File fDest = fileInfo.getFile(true);
                  if (files[iIndex].isLinked()){
                 
                    fDest = files[iIndex].getDestFileFullName();
                   
                      // Can't use fileInfo.setLink(fDest) as it renames
                      // the existing file if there is one
                   
                    dm.getDownloadState().setFileLink( fileInfo.getFile(false), fDest);
                  }
                 
                  if (!files[iIndex].bDownload){
                 
                    toSkip[iIndex] = true;
                   
                    if (!fDest.exists()){
                     
                      if ( reorder_mode && ( fileInfo.getLength()/(1024*1024)) >= reorder_mode_min_mb ){
                       
                        toReorderCompact[iIndex] = true;
                       
                        reorder_comp_num++;
                       
View Full Code Here

        return DisplayFormatters.formatETA(dm.getStats().getETA());
      case 'r':
        long to = 0;
        long tot = 0;
        if (dm.getDiskManager() != null) {
          DiskManagerFileInfo files[] = dm.getDiskManager().getFiles();
          if (files != null) {
            if (files.length>1) {
              int c=0;
              for (int i = 0; i < files.length; i++) {
                if (files[i] != null) {
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.disk.DiskManagerFileInfo

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.