Package org.jmule.core.edonkey

Examples of org.jmule.core.edonkey.FileHash


        return pop_up_menu;
      }

      public void updateRow(SearchResultItem object) {

        FileHash fileHash = object.getFileHash();
        if (_core.getDownloadManager().hasDownload(fileHash)) {
          setForegroundColor(object, color_red);
        }
       
        else if (_core.getSharingManager().hasFile(fileHash))
View Full Code Here


    setRowText(session,  SWTConstants.DOWNLOAD_LIST_COMPLETED_COLUMN_ID, formatter.format(session.getPercentCompleted())+"%");
   
    String speed = SpeedFormatter.formatSpeed(session.getSpeed());
    setRowText(session,  SWTConstants.DOWNLOAD_LIST_DOWNLOAD_SPEED_COLUMN_ID,speed);
   
    FileHash file_hash = session.getFileHash();
    float upload_speed = 0;
    if (upload_manager.hasUpload(file_hash))
      try {
        upload_speed = upload_manager.getUpload(file_hash).getSpeed();
      } catch (UploadManagerException e) {
View Full Code Here

   
    switch(tagType) {
      case TAGTYPE_HASH :
        byte[] hash = new byte[16];
        data.get(hash);
        FileHash tag_hash_data = new FileHash(hash);
        return new HashTag(tagName, tag_hash_data);
 
      case TAGTYPE_STRING :
        if (isExtendedCompressedStringTag) {
          int str_length = (oldTagType) - TAGTYPE_EXSTRING_SHORT_BEGIN;
View Full Code Here

    switch(tagType) {
      case TAGTYPE_HASH :
        data = getByteBuffer(16);
        file.read(data);
        byte[] hash = data.array();
        FileHash tag_hash_data = new FileHash(hash);
        return new HashTag(tagName, tag_hash_data);

      case TAGTYPE_STRING :
        data =  getByteBuffer(2);
        file.read(data);
View Full Code Here

  }

  public List<Source> getFileSources(Int128 targetID) {
    Index indexer =  sources.get(targetID);
   
    FileHash fileHash = new FileHash(targetID.toByteArray());
    if (SharingManagerSingleton.getInstance().hasFile(fileHash)) {
      if (indexer == null) indexer = new Index(targetID);
      SharedFile file = SharingManagerSingleton.getInstance().getSharedFile(fileHash);
      InternalJKadManager _jkad_manager = (InternalJKadManager) JKadManagerSingleton.getInstance();
      ConfigurationManager config_manager = ConfigurationManagerSingleton.getInstance();
View Full Code Here

  }
 
  public static String KadFileIDToFileName(Int128 fileID) {
    byte[] file_id = fileID.toByteArray();
    Convert.updateSearchID(file_id);
    FileHash fileHash = new FileHash(file_id);
    String file_name = JMuleCoreFactory.getSingleton().getSharingManager().getSharedFile(fileHash).getSharingName();
    return file_name;
  }
View Full Code Here

            known_met_entity = known_file_list.get(file_name
                + file_size);
            if (known_met_entity == null) {
              files_needed_to_hash.add(new CompletedFile(file));
            } else {
              FileHash hash = known_met_entity.getFileHash();
              if (files_hash_set.contains(hash))
                files_hash_set.remove(hash);
              if (sharedFiles.get(hash) != null)
                return; // file already in list
              CompletedFile shared_completed_file = new CompletedFile(
View Full Code Here

               
            }
           
            hashset.rewind();
                      
            fileHashSet = new PartHashSet(new FileHash(hashes[0]));
           
            for(int j=1; j < hashes.length;j++){
             
              if(stop) return;
             
View Full Code Here

          byte[] cid = new byte[16];
          rawData.get(cid);
          final Int128 clientID = new Int128(cid);
          byte[] fid = new byte[16];
          rawData.get(fid);
          final FileHash fileHash = new FileHash(fid);
          final short port = rawData.getShort();
          final IPAddress ipAddress = new IPAddress(packet
              .getAddress());

          // final Peer peer = new Peer(buddy.getAddress().toString(),
View Full Code Here

 
    return 0;
  }
 
  public FileHash toFileHash() {
    return new FileHash(toByteArray());
  }
View Full Code Here

TOP

Related Classes of org.jmule.core.edonkey.FileHash

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.