Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

GitServlet.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  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. import javax.servlet.ServletConfig;
  18. import javax.servlet.ServletException;
  19. import javax.servlet.http.HttpServletRequest;
  20. import com.gitblit.manager.IGitblit;
  21. /**
  22. * The GitServlet provides http/https access to Git repositories.
  23. * Access to this servlet is protected by the GitFilter.
  24. *
  25. * @author James Moger
  26. *
  27. */
  28. public class GitServlet extends org.eclipse.jgit.http.server.GitServlet {
  29. private static final long serialVersionUID = 1L;
  30. private final IGitblit gitblit;
  31. public GitServlet(IGitblit gitblit) {
  32. super();
  33. this.gitblit = gitblit;
  34. }
  35. @Override
  36. public void init(ServletConfig config) throws ServletException {
  37. setRepositoryResolver(new RepositoryResolver<HttpServletRequest>(gitblit));
  38. setUploadPackFactory(new GitblitUploadPackFactory<HttpServletRequest>(gitblit));
  39. setReceivePackFactory(new GitblitReceivePackFactory<HttpServletRequest>(gitblit));
  40. super.init(config);
  41. }
  42. }