public String getHostName() { String host = null; try { host = InetAddress.getLocalHost().getHostName(); } catch (Exception e) { try { host = ExecHelper.exec(new String[] { "hostname" }).getOutput().trim(); } catch (Exception ignored) { } } if (host == null) { return "Unknown"; } return host; }
public String getHostName() { String host = null; try { host = InetAddress.getLocalHost().getHostName(); } catch (Exception e) { try { host = ExecHelper.exec(new String[] { "hostname" }).getOutput().trim(); } catch (Exception ignored) { } } if (host == null) { return "Unknown"; } return host; }