Examples of MD5Hash


Examples of com.fathomdb.hash.Md5Hash

  public static Md5Hash md5(byte[] b1, byte[] b2) {
    MessageDigest digest = buildMd5();

    digest.update(b1);
    byte[] hash = digest.digest(b2);
    return new Md5Hash(hash);
  }
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

    MessageDigest digest = buildMd5();

    digest.update(b1);
    digest.update(b2);
    byte[] hash = digest.digest(b3);
    return new Md5Hash(hash);
  }
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

    return new Sha1Hash(hash(digest, inputStream).hash);
  }

  public static Md5Hash md5(InputStream inputStream) throws IOException {
    MessageDigest digest = buildMd5();
    return new Md5Hash(hash(digest, inputStream).hash);
  }
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

    return new Sha1Hash(hash(digest, file).hash);
  }

  public static Md5Hash md5(File file) throws IOException {
    MessageDigest digest = buildMd5();
    return new Md5Hash(hash(digest, file).hash);
  }
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

    return null;
  }

  private Md5Hash tryResolve(CasStore casStore, String specifier) {
    try {
      Md5Hash hash = casStore.findTag(specifier);
      if (hash != null) {
        return hash;
      }
    } catch (Exception e) {
      log.warn("Error while resolving specifier in " + casStore, e);
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

    stagingStores.add(secondary);
  }

  public Md5Hash resolve(String specifier) {
    for (CasStore casStore : primaryList) {
      Md5Hash found = tryResolve(casStore, specifier);
      if (found != null) {
        return found;
      }
    }

    for (CasStore casStore : secondaryList) {
      Md5Hash found = tryResolve(casStore, specifier);
      if (found != null) {
        return found;
      }
    }
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

    // download.setUrl(url);
    // download.hash = new Md5Hash("4c2c969bce8717d6443e184ff91dfdc7");

    String url = apacheMirror + "zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz";
    download.setUrl(url);
    download.hash = new Md5Hash("f64fef86c0bf2e5e0484d19425b22dcb");

    return download;
  }
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

        pullCommand.setKeyPair(srcSshOpsTarget.getKeyPair());

        dest.executeCommand(pullCommand.setTimeout(TimeSpan.TEN_MINUTES));

        Md5Hash targetHash = dest.getFileHash(tempDest);
        Md5Hash srcHash = src.getFileHash(srcFile);

        if (!Objects.equal(srcHash, targetHash)) {
          dest.rm(tempDest);
          throw new OpsException("Files did not match after transfer");
        }
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

        if (!listenFileFuture.isDone()) {
          throw new OpsException("Failed to push file (too many retries");
        }

        Md5Hash targetHash = dest.getFileHash(tempDest);
        Md5Hash srcHash = src.getFileHash(srcFile);

        if (Objects.equal(srcHash, targetHash)) {
          break;
        } else {
          dest.rm(tempDest);
View Full Code Here

Examples of com.fathomdb.hash.Md5Hash

  @Override
  protected void uploadFile(OpsTarget target, File remoteFilePath) throws IOException, OpsException {
    target.mkdir(remoteFilePath.getParentFile());

    Md5Hash resolved = getResolved(target);

    CasStoreObject casObject;
    CasStoreMap casStoreMap = cas.getCasStoreMap(target);

    try {
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.