| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| public static final String | RECEIVE_PACK
Name of the git-receive-pack service. |
| private static final String | |
| public static final String | RECEIVE_PACK_REQUEST_TYPE
Content type supplied by the client to the /git-receive-pack handler. |
| public static final String | RECEIVE_PACK_RESULT_TYPE
Content type returned from the /git-receive-pack handler. |
| private static final List | |
| public static final String | UPLOAD_PACK
Name of the git-upload-pack service. |
| private static final String | |
| public static final String | UPLOAD_PACK_REQUEST_TYPE
Content type supplied by the client to the /git-upload-pack handler. |
| public static final String | UPLOAD_PACK_RESULT_TYPE
Content type returned from the /git-upload-pack handler. |
| public static final List | VALID_SERVICES
Git service names accepted by the /info/refs?service= handler. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: the Content-Type the client expects.current request. req)Get the response Content-Type a client expects for the request. |
| pack-priv static String | |
| public static boolean | Returns: true if the request is likely made by a Git client program.the current HTTP request that may have been made by Git. req)Check a request for Git-over-HTTP indicators. |
| public static boolean | Returns: true if the request is for the /info/refs service.current request. req)Check if the HTTP request was for the /info/refs?service= Git handler. |
| public static boolean | Returns: true if the request is for the /git-receive-pack handler.current request. req)Check if the HTTP request was for the /git-receive-pack Git handler. |
| private static boolean | |
| public static boolean | Returns: true if the request is for the /git-upload-pack handler.path or URI of the request. pathOrUri)Check if the HTTP request path ends with the /git-upload-pack handler. |
| public static boolean | Returns: true if the request is for the /git-upload-pack handler.current request. req)Check if the HTTP request was for the /git-upload-pack Git handler. |
| private static void | |
| public static void | sendError(HttpServletRequest
current request. req, HttpServletResponse current response. res, int HTTP status code to set if the client is not a Git client. httpStatus)Send an error to the Git client or browser. |
| public static void | sendError(HttpServletRequest
current request. req, HttpServletResponse current response. res, int HTTP status code to set if the client is not a Git client. httpStatus, String plain text message to display on the user's console. This is
shown only if the client is likely to be a Git client. If null
or the empty string a default text is chosen based on the HTTP
response code. textForGit)Send an error to the Git client or browser. |
| private static void | sendInfoRefsError(HttpServletRequest req, HttpServletResponse res, String textForGit, int httpStatus)
|
| private static void | sendReceivePackError(HttpServletRequest req, HttpServletResponse res, String textForGit, int httpStatus)
|
| private static void | sendUploadPackError(HttpServletRequest req, HttpServletResponse res, String textForGit, int httpStatus)
|
| public static String | Returns: the path up to the last path component before the service suffix; the path as-is if it contains no service suffix.the path of the request. path)Strip the Git service suffix from a request path. |
| private static void | |
| private static void |
| INFO_REFS | back to summary |
|---|---|
| private static final String INFO_REFS | |
| INFO_REFS_PATH | back to summary |
|---|---|
| private static final String INFO_REFS_PATH | |
| RECEIVE_PACK | back to summary |
|---|---|
| public static final String RECEIVE_PACK Name of the git-receive-pack service. | |
| RECEIVE_PACK_PATH | back to summary |
|---|---|
| private static final String RECEIVE_PACK_PATH | |
| RECEIVE_PACK_REQUEST_TYPE | back to summary |
|---|---|
| public static final String RECEIVE_PACK_REQUEST_TYPE Content type supplied by the client to the /git-receive-pack handler. | |
| RECEIVE_PACK_RESULT_TYPE | back to summary |
|---|---|
| public static final String RECEIVE_PACK_RESULT_TYPE Content type returned from the /git-receive-pack handler. | |
| SERVICE_SUFFIXES | back to summary |
|---|---|
| private static final List<String> SERVICE_SUFFIXES | |
| UPLOAD_PACK | back to summary |
|---|---|
| public static final String UPLOAD_PACK Name of the git-upload-pack service. | |
| UPLOAD_PACK_PATH | back to summary |
|---|---|
| private static final String UPLOAD_PACK_PATH | |
| UPLOAD_PACK_REQUEST_TYPE | back to summary |
|---|---|
| public static final String UPLOAD_PACK_REQUEST_TYPE Content type supplied by the client to the /git-upload-pack handler. | |
| UPLOAD_PACK_RESULT_TYPE | back to summary |
|---|---|
| public static final String UPLOAD_PACK_RESULT_TYPE Content type returned from the /git-upload-pack handler. | |
| VALID_SERVICES | back to summary |
|---|---|
| public static final List<String> VALID_SERVICES Git service names accepted by the /info/refs?service= handler. | |
| GitSmartHttpTools | back to summary |
|---|---|
| private GitSmartHttpTools() | |
| getResponseContentType | back to summary |
|---|---|
| public static String getResponseContentType(HttpServletRequest req) Get the response Content-Type a client expects for the request.
This method should only be invoked if
| |
| infoRefsResultType | back to summary |
|---|---|
| pack-priv static String infoRefsResultType(String svc) | |
| isGitClient | back to summary |
|---|---|
| public static boolean isGitClient(HttpServletRequest req) Check a request for Git-over-HTTP indicators.
| |
| isInfoRefs | back to summary |
|---|---|
| public static boolean isInfoRefs(HttpServletRequest req) Check if the HTTP request was for the /info/refs?service= Git handler.
| |
| isReceivePack | back to summary |
|---|---|
| public static boolean isReceivePack(HttpServletRequest req) Check if the HTTP request was for the /git-receive-pack Git handler.
| |
| isReceivePackSideBand | back to summary |
|---|---|
| private static boolean isReceivePackSideBand(HttpServletRequest req) | |
| isUploadPack | back to summary |
|---|---|
| public static boolean isUploadPack(String pathOrUri) Check if the HTTP request path ends with the /git-upload-pack handler.
| |
| isUploadPack | back to summary |
|---|---|
| public static boolean isUploadPack(HttpServletRequest req) Check if the HTTP request was for the /git-upload-pack Git handler.
| |
| send | back to summary |
|---|---|
| private static void send(HttpServletRequest req, HttpServletResponse res, String type, byte[] buf, int httpStatus) throws IOException | |
| sendError | back to summary |
|---|---|
| public static void sendError(HttpServletRequest req, HttpServletResponse res, int httpStatus) throws IOException Send an error to the Git client or browser. Server implementors may use this method to send customized error messages to a Git protocol client using an HTTP 200 OK response with the error embedded in the payload. If the request was not issued by a Git client, an HTTP response code is returned instead.
| |
| sendError | back to summary |
|---|---|
| public static void sendError(HttpServletRequest req, HttpServletResponse res, int httpStatus, String textForGit) throws IOException Send an error to the Git client or browser. Server implementors may use this method to send customized error messages to a Git protocol client using an HTTP 200 OK response with the error embedded in the payload. If the request was not issued by a Git client, an HTTP response code is returned instead.
This method may only be called before handing off the request to
| |
| sendInfoRefsError | back to summary |
|---|---|
| private static void sendInfoRefsError(HttpServletRequest req, HttpServletResponse res, String textForGit, int httpStatus) throws IOException | |
| sendReceivePackError | back to summary |
|---|---|
| private static void sendReceivePackError(HttpServletRequest req, HttpServletResponse res, String textForGit, int httpStatus) throws IOException | |
| sendUploadPackError | back to summary |
|---|---|
| private static void sendUploadPackError(HttpServletRequest req, HttpServletResponse res, String textForGit, int httpStatus) throws IOException | |
| stripServiceSuffix | back to summary |
|---|---|
| public static String stripServiceSuffix(String path) Strip the Git service suffix from a request path.
Generally the suffix is stripped by the | |
| writePacket | back to summary |
|---|---|
| private static void writePacket(PacketLineOut pckOut, String textForGit) throws IOException | |
| writeSideBand | back to summary |
|---|---|
| private static void writeSideBand(OutputStream out, String textForGit) throws IOException | |