| | |
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import com.google.inject.Inject;
|
| | | import com.google.inject.Singleton;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.apache.wicket.protocol.http.IWebApplicationFactory;
|
| | |
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.eclipse.jgit.revwalk.RevCommit;
|
| | |
|
| | | import com.gitblit.GitBlit;
|
| | | import com.gitblit.IStoredSettings;
|
| | | import com.gitblit.Keys;
|
| | | import com.gitblit.manager.IProjectManager;
|
| | |
| | | * @author James Moger
|
| | | *
|
| | | */
|
| | | @Singleton
|
| | | public class GitblitWicketFilter extends WicketFilter {
|
| | |
|
| | | public GitblitWicketFilter() {
|
| | | private IStoredSettings settings;
|
| | |
|
| | | private IRuntimeManager runtimeManager;
|
| | |
|
| | | private IRepositoryManager repositoryManager;
|
| | |
|
| | | private IProjectManager projectManager;
|
| | |
|
| | | private GitBlitWebApp webapp;
|
| | |
|
| | | @Inject
|
| | | public GitblitWicketFilter(
|
| | | IStoredSettings settings,
|
| | | IRuntimeManager runtimeManager,
|
| | | IRepositoryManager repositoryManager,
|
| | | IProjectManager projectManager,
|
| | | GitBlitWebApp webapp) {
|
| | |
|
| | | this.settings = settings;
|
| | | this.runtimeManager = runtimeManager;
|
| | | this.repositoryManager = repositoryManager;
|
| | | this.projectManager = projectManager;
|
| | | this.webapp = webapp;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return new IWebApplicationFactory() {
|
| | | @Override
|
| | | public WebApplication createApplication(WicketFilter filter) {
|
| | | return new GitBlitWebApp();
|
| | | return webapp;
|
| | | }
|
| | | };
|
| | | }
|
| | |
| | | if (!StringUtils.isEmpty(servletRequest.getParameter("h"))) {
|
| | | commitId = servletRequest.getParameter("h");
|
| | | }
|
| | |
|
| | | IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class);
|
| | | IStoredSettings settings = runtimeManager.getSettings();
|
| | | IRepositoryManager repositoryManager = GitBlit.getManager(IRepositoryManager.class);
|
| | | IProjectManager projectManager = GitBlit.getManager(IProjectManager.class);
|
| | |
|
| | | repo = repo.replace("%2f", "/").replace("%2F", "/").replace(settings.getChar(Keys.web.forwardSlashCharacter, '/'), '/');
|
| | |
|