public static String getLocalhost ( ) throws RuntimeException { String hostname = null ; try { InetAddress addr = InetAddress . getLocalHost ( ) ; hostname = addr . getHostName ( ) ; } catch ( UnknownHostException e ) { throw new RuntimeException ( "[FileHelper] {getLocalhost}: Can't get local hostname" ) ; } return hostname ; }
Gets the hostname of localhost