@Test public void testCompareHashesAndDir() throws Exception { System.out.println( "compareHashesAndDir" ); File hashes = new File("testdata/utils/crc32hashes.txt"); File dir = new File("./testdata/singleFiles/"); Map<File, FileHashComparer.MatchResult> expResult = new HashMap(); expResult.put(hashes, FileHashComparer.MatchResult.MATCH); ComparisonResult results = FileHashComparer.compareHashesAndDir( hashes, dir, FileFilterUtils.trueFileFilter()); assertEquals( FileHashComparer.MatchResult.MATCH, results.getMatches().get(PATH_ORACLE_DS) ); assertEquals( FileHashComparer.MatchResult.MISMATCH, results.getMatches().get(PATH_DATASOURCES) ); assertEquals( FileHashComparer.MatchResult.MISSING, results.getMatches().get(PATH_NON_EXISTENT) ); }
public static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ) throws FileNotFoundException, IOException{ Map<Path, MatchResult> results = compareHashesAndDir( readHashes(hashes), dir, filter ); return new ComparisonResult( dir ).setMatches( results ).setHashes( hashes ); }
FileHashComparer { public static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ) throws FileNotFoundException, IOException{ Map<Path, MatchResult> results = compareHashesAndDir( readHashes(hashes), dir, filter ); return new ComparisonResult( dir ).setMatches( results ).setHashes( hashes ); } }
FileHashComparer { public static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ) throws FileNotFoundException, IOException{ Map<Path, MatchResult> results = compareHashesAndDir( readHashes(hashes), dir, filter ); return new ComparisonResult( dir ).setMatches( results ).setHashes( hashes ); }  }
FileHashComparer { public static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ) throws FileNotFoundException, IOException{ Map<Path, MatchResult> results = compareHashesAndDir( readHashes(hashes), dir, filter ); return new ComparisonResult( dir ).setMatches( results ).setHashes( hashes ); }  static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ); static ComparisonResult compareHashesAndDir( InputStream hashesIS, File dir, IOFileFilter filter ); static Map<String, Long> readHashes( File file ); static Map<String, Long> readHashes( InputStream hashesIS ); static long computeCrc32( File file ); }
FileHashComparer { public static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ) throws FileNotFoundException, IOException{ Map<Path, MatchResult> results = compareHashesAndDir( readHashes(hashes), dir, filter ); return new ComparisonResult( dir ).setMatches( results ).setHashes( hashes ); }  static ComparisonResult compareHashesAndDir( File hashes, File dir, IOFileFilter filter ); static ComparisonResult compareHashesAndDir( InputStream hashesIS, File dir, IOFileFilter filter ); static Map<String, Long> readHashes( File file ); static Map<String, Long> readHashes( InputStream hashesIS ); static long computeCrc32( File file );  }