MD5可用于判断是否为同一文件
File dir = new File(filepath);
InputStream is=null;
String md5="";
if(dir.exists()){
try{
is=new FileInputStream(filepath);
md5 = DigestUtils.md5Hex(IOUtils.toByteArray(is));
IOUtils.closeQuietly(is);
}catch(Exception e){
e.printStackTrace();
}
}
jar包commons-codec-1.8.jar,commons-io-2.4.jar