Here you can find the source of getMd5Script(String dstFilePath)
private static String getMd5Script(String dstFilePath)
//package com.java2s; /*// w w w . j a va 2 s . com Copyright (C) 2014 NTT DATA Corporation This program is free software; you can redistribute it and/or Modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ public class Main { private static String winReturnCode = "\n"; private static String getMd5Script(String dstFilePath) { StringBuffer buffer = new StringBuffer(); buffer.append(String.format("$filePath=\"%s\"" + winReturnCode, dstFilePath)); buffer.append( "$md5=New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider" + winReturnCode); buffer.append( "$hash=[System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($filePath)))" + winReturnCode); buffer.append("$hash" + winReturnCode); return buffer.toString(); } }