public static void main(String[] args) throws IOException {
//检查当前程序的工作目录
System.out.println(System.getProperty("user.dir"));
// 如果不是/开头的想对路径, 那就是从当前程序的工作目录开始找文件的
// Path path = Paths.get("opt/test.txt");
// String md5 = MD5Util.MD5(path.toFile());
// System.out.println(md5);
// 如果是/开头的话, 那就是从当前盘符开始找文件
Path path = Paths.get("/opt/test.txt");
String md5 = MD5Util.MD5(path.toFile());
System.out.println(md5);
}
02-27
05-13
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交