/** * Return the URL prefix for the given node. The latest branch of the node's project will be used to fetch the needed information. * * @param node * @param branch branch * @return scheme and authority or empty string if the branch of the node does not supply the needed information */ private String generateSchemeAuthorityForNode(Node node, Branch branch) { String hostname = branch.getHostname(); if (StringUtils.isEmpty(hostname)) { // Fallback to urls without authority/scheme return ""; } boolean isSSL = BooleanUtils.toBoolean(branch.getSsl()); StringBuffer buffer = new StringBuffer(); if (isSSL) { buffer.append("https://"); } else { buffer.append("http://"); } buffer.append(branch.getHostname()); return buffer.toString(); }