Applications embedding this servlet should map a directory path within the application to this servlet, for example:
<servlet>
<servlet-name>GitServlet</servlet-name>
<servlet-class>org.eclipse.jgit.http.server.GitServlet</servlet-class>
<init-param>
<param-name>base-path</param-name>
<param-value>/var/srv/git</param-value>
</init-param>
<init-param>
<param-name>export-all</param-name>
<param-value>0</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>GitServlet</servlet-name>
<url-pattern>/git/*</url-pattern>
</servlet-mapping>
Applications may wish to add additional repository action URLs to this
servlet by taking advantage of its extension from
org.. Callers may register
their own URL suffix translations through serve(String), or their
regex translations through serveRegex(String). Each translation
should contain a complete filter pipeline which ends with the HttpServlet
that should handle the requested action.
| Modifier and Type | Field and Description |
|---|---|
| private final GitFilter | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addReceivePackFilter(Filter
filter to apply before any of the ReceivePack operations. The
ReceivePack instance is available in the request attribute
filter)org..Add receive-pack filter |
| public void | addUploadPackFilter(Filter
filter to apply before any of the UploadPack operations. The
UploadPack instance is available in the request attribute
filter)org..Add upload-pack filter |
| public void | init(ServletConfig
the config)ServletConfig object that contains configuration information for this servletOverrides org. Implements jakarta. Called by the servlet container to indicate to a servlet that the servlet is being placed into service. |
| public void | setAsIsFileService(AsIsFileService
the filter to validate direct access to repository files
through a dumb client. If f)null then dumb client
support is completely disabled.Set AsIsFileService |
| public void | setReceivePackErrorHandler(ReceivePackErrorHandler
A custom error handler for git-receive-pack. h)Set a custom error handler for git-receive-pack. |
| public void | setReceivePackFactory(ReceivePackFactory<HttpServletRequest>
the factory to construct and configure a
f)org. session when a
push is requested by a client.Set receive-pack factory |
| public void | setRepositoryResolver(RepositoryResolver<HttpServletRequest>
the resolver to use when matching URL to Git repository. If
null the resolver)base-path parameter will be looked for in the
parameter table during init, which usually comes from the
web.xml file of the web application.New servlet configured with a specific resolver. |
| public void | setUploadPackErrorHandler(UploadPackErrorHandler
A custom error handler for git-upload-pack. h)Set a custom error handler for git-upload-pack. |
| public void | setUploadPackFactory(UploadPackFactory<HttpServletRequest>
the factory to construct and configure an
f)org. session when a
fetch or clone is requested by a client.Set upload-pack factory |
| gitFilter | back to summary |
|---|---|
| private final GitFilter gitFilter | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. | |
| GitServlet | back to summary |
|---|---|
| public GitServlet() New servlet that will load its base directory from
The required parameter | |
| addReceivePackFilter | back to summary |
|---|---|
| public void addReceivePackFilter(Filter filter) Add receive-pack filter
| |
| addUploadPackFilter | back to summary |
|---|---|
| public void addUploadPackFilter(Filter filter) Add upload-pack filter
| |
| init | back to summary |
|---|---|
| public void init(ServletConfig config) throws ServletException Overrides org. Implements jakarta. Doc from jakarta. Called by the servlet container to indicate to a servlet that the servlet is being placed into service. See
This implementation stores the
| |
| setAsIsFileService | back to summary |
|---|---|
| public void setAsIsFileService(AsIsFileService f) Set AsIsFileService
| |
| setReceivePackErrorHandler | back to summary |
|---|---|
| public void setReceivePackErrorHandler(ReceivePackErrorHandler h) Set a custom error handler for git-receive-pack.
| |
| setReceivePackFactory | back to summary |
|---|---|
| public void setReceivePackFactory(ReceivePackFactory<HttpServletRequest> f) Set receive-pack factory
| |
| setRepositoryResolver | back to summary |
|---|---|
| public void setRepositoryResolver(RepositoryResolver<HttpServletRequest> resolver) New servlet configured with a specific resolver.
| |
| setUploadPackErrorHandler | back to summary |
|---|---|
| public void setUploadPackErrorHandler(UploadPackErrorHandler h) Set a custom error handler for git-upload-pack.
| |
| setUploadPackFactory | back to summary |
|---|---|
| public void setUploadPackFactory(UploadPackFactory<HttpServletRequest> f) Set upload-pack factory
| |