private void setLocalHostProperty ( ) { String hostName = "unkown" ; try { hostName = InetAddress . getLocalHost ( ) . getHostName ( ) ; } catch ( UnknownHostException e ) { error ( "Unable to resolve hostname, setting hostname as 'unkown'" ) ; } System . setProperty ( "host.name" , hostName ) ; }
Gets the local host if it can and sets it as a system property