1 /*
2 * Copyright (C) 2015, Google Inc. and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * https://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11 package org.eclipse.jgit.transport;
12
13 /**
14 * Internal API to assist {@code org.eclipse.jgit.http.server}.
15 * <p>
16 * <b>Do not call.</b>
17 *
18 * @since 4.0
19 */
20 public class InternalHttpServerGlue {
21 /**
22 * Apply a default user agent for a request.
23 *
24 * @param up
25 * current UploadPack instance.
26 * @param agent
27 * user agent string from the HTTP headers.
28 */
29 public static void setPeerUserAgent(UploadPack up, String agent) {
30 up.userAgent = agent;
31 }
32
33 /**
34 * Apply a default user agent for a request.
35 *
36 * @param rp
37 * current ReceivePack instance.
38 * @param agent
39 * user agent string from the HTTP headers.
40 */
41 public static void setPeerUserAgent(ReceivePack rp, String agent) {
42 rp.userAgent = agent;
43 }
44
45 private InternalHttpServerGlue() {
46 }
47 }