2008-11-14 16:38:36 +00:00
|
|
|
package zutil.test;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.net.URISyntaxException;
|
2010-01-31 18:10:00 +00:00
|
|
|
import java.util.List;
|
2008-11-14 16:38:36 +00:00
|
|
|
|
|
|
|
|
import zutil.FileFinder;
|
|
|
|
|
import zutil.Hasher;
|
|
|
|
|
|
|
|
|
|
public class FileFinderHasherTest {
|
|
|
|
|
public static void main(String[] args) throws URISyntaxException{
|
|
|
|
|
String relativePath = "zutil/test";
|
|
|
|
|
|
|
|
|
|
File path = FileFinder.find(relativePath);
|
2010-01-31 18:10:00 +00:00
|
|
|
List<File> files = FileFinder.search(path);
|
2008-11-14 16:38:36 +00:00
|
|
|
for(int i=0; i<files.size(); i++){
|
|
|
|
|
try {
|
|
|
|
|
System.out.println(
|
|
|
|
|
FileFinder.relativePath(files.get(i), relativePath)+
|
|
|
|
|
": "+Hasher.hash(files.get(i),"MD5"));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|