static boolean isPortAvailable ( int port ) { ServerSocket ss = null ; try { ss = new ServerSocket ( port ) ; ss . setReuseAddress ( true ) ; return true ; } catch ( IOException ioe ) { // NOSONAR return false ; } finally { closeQuietly ( ss ) ; } }
Find out if the provided port is available .