InternalHttpServerGlue.java

  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. package org.eclipse.jgit.transport;

  11. /**
  12.  * Internal API to assist {@code org.eclipse.jgit.http.server}.
  13.  * <p>
  14.  * <b>Do not call.</b>
  15.  *
  16.  * @since 4.0
  17.  */
  18. public class InternalHttpServerGlue {
  19.     /**
  20.      * Apply a default user agent for a request.
  21.      *
  22.      * @param up
  23.      *            current UploadPack instance.
  24.      * @param agent
  25.      *            user agent string from the HTTP headers.
  26.      */
  27.     public static void setPeerUserAgent(UploadPack up, String agent) {
  28.         up.userAgent = agent;
  29.     }

  30.     /**
  31.      * Apply a default user agent for a request.
  32.      *
  33.      * @param rp
  34.      *            current ReceivePack instance.
  35.      * @param agent
  36.      *            user agent string from the HTTP headers.
  37.      */
  38.     public static void setPeerUserAgent(ReceivePack rp, String agent) {
  39.         rp.userAgent = agent;
  40.     }

  41.     private InternalHttpServerGlue() {
  42.     }
  43. }