mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 08:25:44 +01:00
improve UrlBuilder
This commit is contained in:
@@ -77,7 +77,7 @@ public class UrlBuilder
|
|||||||
*/
|
*/
|
||||||
public UrlBuilder append(String part)
|
public UrlBuilder append(String part)
|
||||||
{
|
{
|
||||||
url = HttpUtil.append(url, part);
|
url = url.concat(part);
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -139,11 +139,32 @@ public class UrlBuilder
|
|||||||
{
|
{
|
||||||
url = new StringBuilder(url).append(separator).append(name).append(
|
url = new StringBuilder(url).append(separator).append(name).append(
|
||||||
HttpUtil.SEPARATOR_PARAMETER_VALUE).append(value).toString();
|
HttpUtil.SEPARATOR_PARAMETER_VALUE).append(value).toString();
|
||||||
|
parameterAdded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method description
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param part
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public UrlBuilder appendUrlPart(String part)
|
||||||
|
{
|
||||||
|
if (parameterAdded)
|
||||||
|
{
|
||||||
|
throw new IllegalStateException("parameter added");
|
||||||
|
}
|
||||||
|
|
||||||
|
url = HttpUtil.append(url, part);
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method description
|
* Method description
|
||||||
*
|
*
|
||||||
@@ -176,6 +197,9 @@ public class UrlBuilder
|
|||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|
||||||
|
/** Field description */
|
||||||
|
private boolean parameterAdded = false;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private String separator;
|
private String separator;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user