private void writeCygwinCleanup ( File file , BufferedWriter bw ) throws IOException { // Under cygwin, must explicitly kill the process that runs // the server. It simply does not die on its own. And it's // JVM holds file locks which will prevent cleanup of extraction // directory. So kill it. String pid = getPID ( dir , serverName ) ; if ( pid != null ) bw . write ( "kill " + pid + "\n" ) ; writeUnixCleanup ( file , bw ) ; }
Write logic for Cygwin cleanup script