Examples of FileChecksum


Examples of org.apache.hadoop.fs.FileChecksum

      // Mark files as equals, since user asked for no checksum verification
      if (!verifyChecksum) return true;

      // If checksums are not available, files are not the same.
      FileChecksum inChecksum = getFileChecksum(inputFs, inputStat.getPath());
      if (inChecksum == null) return false;

      FileChecksum outChecksum = getFileChecksum(outputFs, outputStat.getPath());
      if (outChecksum == null) return false;

      return inChecksum.equals(outChecksum);
    }
View Full Code Here

Examples of org.syncany.database.FileContent.FileChecksum

    FileVersionComparator versionComparator = new FileVersionComparator(config.getLocalDir(), config.getChunker().getChecksumAlgorithm());
   
    FileVersion fileVersion = new FileVersion();
    fileVersion.setVersion(3L);

    fileVersion.setChecksum(new FileChecksum(new byte[] { 0x11, 0x22, 0x33 }));
    fileVersion.setLastModified(new Date(123456789));
    fileVersion.setPath("folder/file");
    fileVersion.setSize(999*1024L);
    fileVersion.setLinkTarget(null);
    fileVersion.setStatus(FileStatus.CHANGED);
    fileVersion.setType(FileType.FILE);
   
    if (EnvironmentUtil.isWindows()) {
      fileVersion.setDosAttributes("rha-");
    }
    else if (EnvironmentUtil.isUnixLikeOperatingSystem()) {
      fileVersion.setPosixPermissions("rw-rw-r-x");
    }
   
    // Run
    FileProperties fileProperties = versionComparator.captureFileProperties(fileVersion);
   
    // Test
    assertEquals(new FileChecksum(new byte[] { 0x11, 0x22, 0x33 }), fileProperties.getChecksum());
    assertEquals(123456789, fileProperties.getLastModified());
    assertEquals("folder/file", fileProperties.getRelativePath());
    assertEquals(999*1024, fileProperties.getSize());
    assertNull(fileProperties.getLinkTarget());
    assertTrue(fileProperties.exists());
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.