diff options
author | James Moger <james.moger@gitblit.com> | 2013-01-15 22:17:08 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-01-15 22:41:20 -0500 |
commit | 93d506581010cdb6308ae3d282a8bc513966d70d (patch) | |
tree | a0b11035f4feb010a3e68f92c22ff4d74b062ff3 /src/com/gitblit/RobotsTxtServlet.java | |
parent | 657a6596eb95635abd29c0a21befffc43da49d09 (diff) | |
download | gitblit-93d506581010cdb6308ae3d282a8bc513966d70d.tar.gz gitblit-93d506581010cdb6308ae3d282a8bc513966d70d.zip |
Support --baseFolder parameter and small data reorganization
Diffstat (limited to 'src/com/gitblit/RobotsTxtServlet.java')
-rw-r--r-- | 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 c142be0d..d66ebf43 100644 --- a/src/com/gitblit/RobotsTxtServlet.java +++ b/src/com/gitblit/RobotsTxtServlet.java @@ -24,7 +24,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import com.gitblit.utils.FileUtils;
-import com.gitblit.utils.StringUtils;
/**
* Handles requests for robots.txt
@@ -55,13 +54,10 @@ 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 {
- 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);
}
|