diff --git a/heron/tools/apiserver/src/java/com/twitter/heron/apiserver/resources/FileResource.java b/heron/tools/apiserver/src/java/com/twitter/heron/apiserver/resources/FileResource.java index b94c912a863..f2dce0c0bc6 100644 --- a/heron/tools/apiserver/src/java/com/twitter/heron/apiserver/resources/FileResource.java +++ b/heron/tools/apiserver/src/java/com/twitter/heron/apiserver/resources/FileResource.java @@ -157,8 +157,12 @@ private String getHostNameOrIP() { // Override hostname if provided in flags if (StringUtil.isNotBlank(getDownloadHostName())) { return getDownloadHostName(); + } else if (StringUtil.isNotBlank(hostname)) { + return hostname; + } else if (ip != null && StringUtil.isNotBlank(ip.toString())) { + return ip.toString(); } - return (hostname != null) ? hostname : ((ip != null) ? ip.toString() : ""); + return ""; } }