James Moger
2013-07-02 2e4b03f7fe33ed5b84ec98ce689f3e1cabf97bff
commit | author | age
75bca8 1 /*
JM 2  * Copyright 2011 gitblit.com.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.gitblit.git;
17
18 import javax.servlet.ServletConfig;
19 import javax.servlet.ServletException;
20 import javax.servlet.http.HttpServletRequest;
21
22 import com.gitblit.GitBlit;
23
24 /**
25  * The GitServlet provides http/https access to Git repositories.
26  * Access to this servlet is protected by the GitFilter.
27  * 
28  * @author James Moger
29  * 
30  */
31 public class GitServlet extends org.eclipse.jgit.http.server.GitServlet {
32
33     private static final long serialVersionUID = 1L;
34
35     @Override
36     public void init(ServletConfig config) throws ServletException {
37         setRepositoryResolver(new RepositoryResolver<HttpServletRequest>(GitBlit.getRepositoriesFolder()));
38         setUploadPackFactory(new GitblitUploadPackFactory<HttpServletRequest>());
39         setReceivePackFactory(new GitblitReceivePackFactory<HttpServletRequest>());
40         super.init(config);
41     }
42 }