mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-03 13:19:10 +01:00
added javadoc and unit test
This commit is contained in:
@@ -59,7 +59,7 @@ import java.util.List;
|
||||
* @author Sebastian Sdorra
|
||||
*/
|
||||
@StaticPermissions(
|
||||
value = "repository",
|
||||
value = "repository",
|
||||
permissions = {"read", "write", "modify", "delete", "healthCheck"}
|
||||
)
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@@ -356,9 +356,7 @@ public class Repository extends BasicPropertiesAware implements ModelObject, Per
|
||||
* @since 1.17
|
||||
*/
|
||||
public String createUrl(String baseUrl) {
|
||||
String url = HttpUtil.append(baseUrl, type);
|
||||
|
||||
return HttpUtil.concatenate(url, namespace, name);
|
||||
return HttpUtil.concatenate(baseUrl, type, namespace, name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,9 +82,9 @@ public final class HttpUtil
|
||||
|
||||
/**
|
||||
* Name of bearer authentication cookie.
|
||||
*
|
||||
*
|
||||
* TODO find a better place
|
||||
*
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static final String COOKIE_BEARER_AUTHENTICATION = "X-Bearer-Token";
|
||||
@@ -97,7 +97,7 @@ public final class HttpUtil
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static final String HEADER_AUTHORIZATION = "Authorization";
|
||||
|
||||
|
||||
/**
|
||||
* content-length header
|
||||
* @since 1.46
|
||||
@@ -248,6 +248,14 @@ public final class HttpUtil
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Joins all path elements together separated by {@code {@link #SEPARATOR_PATH}}.
|
||||
*
|
||||
* @param pathElements path elements
|
||||
*
|
||||
* @return concatenated path
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public static String concatenate(String... pathElements) {
|
||||
return Arrays.stream(pathElements).reduce(HttpUtil::append).orElse("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user