diff options
Diffstat (limited to 'src/main/java/com/gitblit/servlet/DownloadZipServlet.java')
-rw-r--r-- | src/main/java/com/gitblit/servlet/DownloadZipServlet.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/main/java/com/gitblit/servlet/DownloadZipServlet.java b/src/main/java/com/gitblit/servlet/DownloadZipServlet.java index 437a9c26..6a64778c 100644 --- a/src/main/java/com/gitblit/servlet/DownloadZipServlet.java +++ b/src/main/java/com/gitblit/servlet/DownloadZipServlet.java @@ -21,7 +21,6 @@ import java.text.ParseException; import java.util.Date;
import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jgit.lib.Repository;
@@ -32,13 +31,15 @@ import org.slf4j.LoggerFactory; import com.gitblit.Constants;
import com.gitblit.IStoredSettings;
import com.gitblit.Keys;
+import com.gitblit.dagger.DaggerServlet;
import com.gitblit.manager.IRepositoryManager;
-import com.gitblit.manager.IRuntimeManager;
import com.gitblit.utils.CompressionUtils;
import com.gitblit.utils.JGitUtils;
import com.gitblit.utils.MarkdownUtils;
import com.gitblit.utils.StringUtils;
+import dagger.ObjectGraph;
+
/**
* Streams out a zip file from the specified repository for any tree path at any
* revision.
@@ -46,15 +47,15 @@ import com.gitblit.utils.StringUtils; * @author James Moger
*
*/
-public class DownloadZipServlet extends HttpServlet {
+public class DownloadZipServlet extends DaggerServlet {
private static final long serialVersionUID = 1L;
private transient Logger logger = LoggerFactory.getLogger(DownloadZipServlet.class);
- private final IStoredSettings settings;
+ private IStoredSettings settings;
- private final IRepositoryManager repositoryManager;
+ private IRepositoryManager repositoryManager;
public static enum Format {
zip(".zip"), tar(".tar"), gz(".tar.gz"), xz(".tar.xz"), bzip2(".tar.bzip2");
@@ -75,13 +76,10 @@ public class DownloadZipServlet extends HttpServlet { }
}
- public DownloadZipServlet(
- IRuntimeManager runtimeManager,
- IRepositoryManager repositoryManager) {
-
- super();
- this.settings = runtimeManager.getSettings();
- this.repositoryManager = repositoryManager;
+ @Override
+ protected void inject(ObjectGraph dagger) {
+ this.settings = dagger.get(IStoredSettings.class);
+ this.repositoryManager = dagger.get(IRepositoryManager.class);
}
/**
|