From 269c5043ab8f66f67d5719ac5149a436ca1baa2b Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Fri, 29 Nov 2013 11:05:51 -0500 Subject: [PATCH] Extract Federation, Gitblit and Services manager from GitBlit singleton --- src/main/java/com/gitblit/DownloadZipFilter.java | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gitblit/DownloadZipFilter.java b/src/main/java/com/gitblit/DownloadZipFilter.java index 90a7649..914d89e 100644 --- a/src/main/java/com/gitblit/DownloadZipFilter.java +++ b/src/main/java/com/gitblit/DownloadZipFilter.java @@ -15,7 +15,13 @@ */ package com.gitblit; +import javax.inject.Inject; +import javax.inject.Singleton; + import com.gitblit.Constants.AccessRestrictionType; +import com.gitblit.manager.IRepositoryManager; +import com.gitblit.manager.IRuntimeManager; +import com.gitblit.manager.ISessionManager; import com.gitblit.models.RepositoryModel; import com.gitblit.models.UserModel; @@ -23,15 +29,25 @@ * The DownloadZipFilter is an AccessRestrictionFilter which ensures that zip * requests for view-restricted repositories have proper authentication * credentials and are authorized. - * + * * @author James Moger - * + * */ +@Singleton public class DownloadZipFilter extends AccessRestrictionFilter { + + @Inject + public DownloadZipFilter( + IRuntimeManager runtimeManager, + ISessionManager sessionManager, + IRepositoryManager repositoryManager) { + + super(runtimeManager, sessionManager, repositoryManager); + } /** * Extract the repository name from the url. - * + * * @param url * @return repository name */ @@ -47,7 +63,7 @@ /** * Analyze the url and returns the action of the request. - * + * * @param url * @return action of the request */ @@ -58,7 +74,7 @@ /** * Determine if a non-existing repository can be created using this filter. - * + * * @return true if the filter allows repository creation */ @Override @@ -68,7 +84,7 @@ /** * Determine if the action may be executed on the repository. - * + * * @param repository * @param action * @return true if the action may be performed @@ -80,7 +96,7 @@ /** * Determine if the repository requires authentication. - * + * * @param repository * @param action * @return true if authentication required @@ -93,7 +109,7 @@ /** * Determine if the user can access the repository and perform the specified * action. - * + * * @param repository * @param user * @param action -- Gitblit v1.9.1