Package jetbrains.buildServer.http
Class HttpUserAgent
- java.lang.Object
-
- jetbrains.buildServer.http.HttpUserAgent
-
public class HttpUserAgent extends Object
Holder of value of default User-Agent for an agent or a server.- Since:
- 2018.1.2
- Author:
- Mikhail Khorkov
-
-
Field Summary
Fields Modifier and Type Field Description static StringAGENT_HEADER_PREFIXstatic StringSERVER_HEADER_PREFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends org.apache.commons.httpclient.HttpMethod>
TaddHeader(T method)Add default user agent in headerUser-Agentstatic StringgetUserAgent()Gets default User-Agent value.static voidsetAgentFlag()Sets flag that the code are executed in an agent context but not in a server.static voidsetServerFlag()Sets flag that the code are executed in a server context but not in an agent.
-
-
-
Field Detail
-
SERVER_HEADER_PREFIX
@NotNull public static final String SERVER_HEADER_PREFIX
- See Also:
- Constant Field Values
-
AGENT_HEADER_PREFIX
@NotNull public static final String AGENT_HEADER_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUserAgent
@NotNull public static String getUserAgent()
Gets default User-Agent value.
-
setServerFlag
public static void setServerFlag()
Sets flag that the code are executed in a server context but not in an agent.
-
setAgentFlag
public static void setAgentFlag()
Sets flag that the code are executed in an agent context but not in a server.
-
addHeader
@NotNull public static <T extends org.apache.commons.httpclient.HttpMethod> T addHeader(@NotNull T method)Add default user agent in headerUser-Agent- Returns:
- the same
HttpMethodwith the new header.
-
-