From 93d506581010cdb6308ae3d282a8bc513966d70d Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 15 Jan 2013 22:41:20 -0500
Subject: [PATCH] Support --baseFolder parameter and small data reorganization

---
 src/com/gitblit/RobotsTxtServlet.java |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/com/gitblit/RobotsTxtServlet.java b/src/com/gitblit/RobotsTxtServlet.java
index c142be0..d66ebf4 100644
--- a/src/com/gitblit/RobotsTxtServlet.java
+++ b/src/com/gitblit/RobotsTxtServlet.java
@@ -24,7 +24,6 @@
 import javax.servlet.http.HttpServletResponse;
 
 import com.gitblit.utils.FileUtils;
-import com.gitblit.utils.StringUtils;
 
 /**
  * Handles requests for robots.txt
@@ -55,13 +54,10 @@
 	protected void processRequest(javax.servlet.http.HttpServletRequest request,
 			javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException,
 			java.io.IOException {
-		String robotstxt = GitBlit.getString(Keys.web.robots.txt, null);		
+		File file = GitBlit.getFileOrFolder(Keys.web.robots.txt, null);
 		String content = "";
-		if (!StringUtils.isEmpty(robotstxt)) {
-			File robotsfile = new File(robotstxt);
-			if (robotsfile.exists()) {
-				content = FileUtils.readContent(robotsfile, "\n");
-			}
+		if (file.exists()) {
+			content = FileUtils.readContent(file, "\n");
 		}
 		response.getWriter().append(content);
 	}

--
Gitblit v1.9.1