summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/RobotsTxtServlet.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-11-18 22:31:37 -0500
committerJames Moger <james.moger@gitblit.com>2013-11-29 11:05:46 -0500
commitcacf8bff097fbb66a7be1bfe267b5da2605145f8 (patch)
tree7096df41b5944c569b1db24203eae8dcfa26ba04 /src/main/java/com/gitblit/RobotsTxtServlet.java
parent79cad53bba094cffa1d25581edbf4972a5158cd4 (diff)
downloadgitblit-cacf8bff097fbb66a7be1bfe267b5da2605145f8.tar.gz
gitblit-cacf8bff097fbb66a7be1bfe267b5da2605145f8.zip
Use Dagger to inject managers into all filters and servlets
Change-Id: I9bb2cc0cbfac9841b13bed15a474fefb24355cd4
Diffstat (limited to 'src/main/java/com/gitblit/RobotsTxtServlet.java')
-rw-r--r--src/main/java/com/gitblit/RobotsTxtServlet.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/RobotsTxtServlet.java b/src/main/java/com/gitblit/RobotsTxtServlet.java
index 6a7c02d3..c07aa1d0 100644
--- a/src/main/java/com/gitblit/RobotsTxtServlet.java
+++ b/src/main/java/com/gitblit/RobotsTxtServlet.java
@@ -18,6 +18,8 @@ package com.gitblit;
import java.io.File;
import java.io.IOException;
+import javax.inject.Inject;
+import javax.inject.Singleton;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -32,12 +34,17 @@ import com.gitblit.utils.FileUtils;
* @author James Moger
*
*/
+@Singleton
public class RobotsTxtServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
- public RobotsTxtServlet() {
+ private final IRuntimeManager runtimeManager;
+
+ @Inject
+ public RobotsTxtServlet(IRuntimeManager runtimeManager) {
super();
+ this.runtimeManager = runtimeManager;
}
@Override
@@ -55,7 +62,6 @@ public class RobotsTxtServlet extends HttpServlet {
protected void processRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException,
java.io.IOException {
- IRuntimeManager runtimeManager = GitBlit.getManager(IRuntimeManager.class);
File file = runtimeManager.getFileOrFolder(Keys.web.robots.txt, null);
String content = "";
if (file.exists()) {