Examples of PartialFile


Examples of org.jmule.core.sharingmanager.PartialFile

    completed.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (shared_file instanceof PartialFile) {
      refresher = new Refreshable(){

        public void refresh() {
          PartialFile p_file = (PartialFile) shared_file;
          completed.setText(FileFormatter.formatProgress(p_file.getPercentCompleted()));
        }
       
      };
      GUIUpdater.getInstance().addRefreshable(refresher);
    }else
View Full Code Here

Examples of org.jmule.core.sharingmanager.PartialFile

        setRowText(object, SWTConstants.SHARED_LIST_FILE_SIZE_COLUMN_ID, FileFormatter.formatFileSize(file_size));
        String mime_type = FileFormatter.formatMimeType(object.getMimeType());
        setRowText(object,SWTConstants.SHARED_LIST_FILE_TYPE_COLUMN_ID,mime_type);
        double percent_completed = 100d;
        if (object instanceof PartialFile) {
          PartialFile partial_file = (PartialFile)object;
          percent_completed = partial_file.getPercentCompleted();
        }
        if (status == HASHED) {
            setRowText(object,SWTConstants.SHARED_LIST_COMPLETED_COLUMN_ID,FileFormatter.formatProgress(percent_completed));
            setRowText(object,SWTConstants.SHARED_LIST_FILE_ID_COLUMN_ID, object.getFileHash().getAsString());
        } else
View Full Code Here

Examples of org.jmule.core.sharingmanager.PartialFile

  }
 
  public boolean sharingCompleteFile() {
    boolean result = sharedFile instanceof CompletedFile;
    if (!result) {
      PartialFile pFile = (PartialFile) sharedFile;
      if (pFile.getPercentCompleted() == 100d)
        result = true;
    }

    return result;
  }
View Full Code Here

Examples of org.jmule.core.sharingmanager.PartialFile

 
  void receivedFileChunkRequestFromPeer(Peer sender,
      FileHash fileHash, List<FileChunkRequest> chunkList) {
   
    if (sharedFile instanceof PartialFile) {
      PartialFile partial_file = (PartialFile) sharedFile;
      GapList gapList = partial_file.getGapList();
//      System.out.println("Request from partial file : \n" + partial_file);
      for(FileChunkRequest request : chunkList) {
//        System.out.println("Gap request : " + request+"\nIntersected gaps :");
//        for(Gap gap : gapList.getIntersectedGaps(request.getChunkBegin(), request.getChunkEnd()))
//          System.out.println(gap);
View Full Code Here

Examples of org.jmule.core.sharingmanager.PartialFile

  }
 
  private void createDownloadFiles(String fileName, long fileSize,
      FileHash fileHash, PartHashSet hashSet, TagList tagList)
      throws SharedFileException {
    sharedFile = new PartialFile(fileName, fileSize, fileHash, hashSet,
        tagList);
    SharingManagerSingleton.getInstance().addPartialFile(sharedFile);
  }
View Full Code Here

Examples of org.jmule.core.sharingmanager.PartialFile

      // requested file not found!
      return ;
    }
    SharedFile shared_file = _sharing_manager.getSharedFile(fileHash);
    if (shared_file instanceof PartialFile){
      PartialFile partialFile = (PartialFile) shared_file;
      _network_manager.sendFileStatusAnswer(sender.getIP(), sender.getPort(), shared_file.getHashSet(), shared_file.length() ,partialFile.getGapList());
    } else {
      _network_manager.sendFileStatusAnswer(sender.getIP(), sender.getPort(), shared_file.getHashSet(), shared_file.length() ,new GapList());
    }
  }
View Full Code Here

Examples of org.jmule.core.sharingmanager.PartialFile

          if (publishedFiles.contains(file.getFileHash()))
            continue;
          if (filesToPublish > JKadConstants.ITERATION_MAX_PUBLISH_FILES)
            break;
          if (file instanceof PartialFile) {
            PartialFile p_file = (PartialFile) file;
            if (p_file.getAvailablePartCount()==0) continue;
          }
          publishedFiles.add(file.getFileHash());

          byte[] hash = file.getFileHash().getHash().clone();
          Convert.updateSearchID(hash);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.