/** * joins an array of {@link Object}s, separated by a {@link String} * * @param parts the parts to join * @param separator the {@link String} to separates the elements * @return a {@link String} of all elements, separated by {@code separator} */ public static String join(String separator, String... parts) { return join(parts == null ? null : Arrays.asList(parts), separator); }
/** * constructs the string representation of the path. * * @return a string. */ public String asString() { if (size() == 1 && hasTrailingSlash()) { // special case if only one part, then join will not append the delimter. return PATH_DELIMITER; } return StringUtils.join(segments, PATH_DELIMITER); }