| | |
| | | */
|
| | | package com.gitblit.servlet;
|
| | |
|
| | | import com.google.inject.Inject;
|
| | | import com.google.inject.Singleton;
|
| | |
|
| | | import com.gitblit.Constants.AccessRestrictionType;
|
| | | import com.gitblit.manager.IAuthenticationManager;
|
| | | import com.gitblit.manager.IRepositoryManager;
|
| | |
| | | * @author James Moger
|
| | | *
|
| | | */
|
| | | @Singleton
|
| | | public class DownloadZipFilter extends AccessRestrictionFilter {
|
| | |
|
| | | @Inject
|
| | | public DownloadZipFilter(
|
| | | IRuntimeManager runtimeManager,
|
| | | IAuthenticationManager authenticationManager,
|
| | |
| | | @Override
|
| | | protected String extractRepositoryName(String url) {
|
| | | int a = url.indexOf("r=");
|
| | | String repository = url.substring(a + 2);
|
| | | if (repository.indexOf('&') > -1) {
|
| | | repository = repository.substring(0, repository.indexOf('&'));
|
| | | if (a > -1) {
|
| | | String repository = url.substring(a + 2);
|
| | | if (repository.indexOf('&') > -1) {
|
| | | repository = repository.substring(0, repository.indexOf('&'));
|
| | | }
|
| | | return repository;
|
| | | }
|
| | | return repository;
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|