private String getPID ( String dir , String serverName ) { String pid = null ; if ( platformType == SelfExtractUtils . PlatformType_CYGWIN ) { String pidFile = dir + File . separator + "wlp" + File . separator + "usr" + File . separator + "servers" + File . separator + ".pid" + File . separator + serverName + ".pid" ; try { BufferedReader br = new BufferedReader ( new InputStreamReader ( new FileInputStream ( pidFile ) , "UTF-8" ) ) ; try { return br . readLine ( ) ; } finally { br . close ( ) ; } } catch ( IOException e ) { pid = null ; } if ( pid == null ) { Object [ ] substitution = { dir } ; System . out . println ( MessageFormat . format ( resourceBundle . getString ( "UNABLE_TO_FIND_PID" ) , substitution ) ) ; } } return pid ; }
Return PID from server directory for cygwin environment only .