From f76fee63ed9cb3a30d3c0c092d860b1cb93a481b Mon Sep 17 00:00:00 2001
From: Gerard Smyth <gerard.smyth@gmail.com>
Date: Thu, 08 May 2014 13:09:30 -0400
Subject: [PATCH] Updated the SyndicationServlet to provide an additional option to return details of the tags in the repository instead of the commits. This uses a new 'ot' request parameter to indicate the object type of the content to return, which can be ither TAG or COMMIT. If this is not provided, then COMMIT is assumed to maintain backwards compatability. If tags are returned, then the paging parameters, 'l' and 'pg' are still supported, but searching options are currently ignored.
---
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 437a9c2..6a64778 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.util.Date;
import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jgit.lib.Repository;
@@ -32,12 +31,14 @@
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
@@ -46,15 +47,15 @@
* @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 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);
}
/**
--
Gitblit v1.9.1