Package org.hive2hive.core.processes.implementations.files.list

Examples of org.hive2hive.core.processes.implementations.files.list.FileTaste


     * Start the verification: remove files that are not in the DHT yet and remove files that equal to the
     * ones in the DHT.
     */
    Set<File> toDelete = new HashSet<File>();
    for (File file : fileBuffer) {
      FileTaste fileTaste = null;
      for (FileTaste syncFile : syncFiles) {
        if (syncFile.getFile().equals(file)) {
          fileTaste = syncFile;
          break;
        }
      }

      if (fileTaste == null) {
        // don't modify a file that is not in the DHT
        toDelete.add(file);
      } else {
        try {
          // check for MD5 hashes, if equal, skip the file
          byte[] fileHash = EncryptionUtil.generateMD5Hash(file);
          if (H2HEncryptionUtil.compareMD5(fileHash, fileTaste.getMd5())) {
            // hashes are equal, no need to upload it to the DHT
            toDelete.add(file);
          }
        } catch (IOException e) {
          logger.warn("Could not generate the MD5 hash of the file to be able to compare against the file taste.");
View Full Code Here

TOP

Related Classes of org.hive2hive.core.processes.implementations.files.list.FileTaste

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.