Commit 208a7418 by Ryan Baxter Committed by GitHub

Merge pull request #1732 from utsman/master

Refactor ZoneUtils class
parents c0fefc4d c953d59b
......@@ -30,15 +30,8 @@ public class ZoneUtils {
* @return The approximate zone
*/
public static String extractApproximateZone(String host) {
if (!host.contains(".")) {
return host;
}
String[] split = StringUtils.split(host, ".");
StringBuilder builder = new StringBuilder(split[1]);
for (int i = 2; i < split.length; i++) {
builder.append(".").append(split[i]);
}
return builder.toString();
return split == null ? host : split[1];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment