/** * Returns the query parameter for the given branch. This is the query parameter that is necessary to get the * node in the correct branch. * If the given branch is the latest branch, no query parameter is necessary and thus an empty string is returned. * * @param branch The branch to generate the query parameter for. * @return Example: "?branch=test1" */ private String branchQueryParameter(Branch branch) { if (branch.isLatest()) { return ""; } return String.format("?%s=%s", VersioningParameters.BRANCH_QUERY_PARAM_KEY, branch.getName()); } }