01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.responders;
04:
05: import fitnesse.*;
06: import fitnesse.authentication.*;
07: import fitnesse.wiki.*;
08: import fitnesse.http.*;
09:
10: public class RawContentResponder implements SecureResponder {
11: public Response makeResponse(FitNesseContext context,
12: Request request) throws Exception {
13: String resource = request.getResource();
14: WikiPagePath path = PathParser.parse(resource);
15: WikiPage page = context.root.getPageCrawler().getPage(
16: context.root, path);
17: if (page == null)
18: return new NotFoundResponder().makeResponse(context,
19: request);
20: PageData pageData = page.getData();
21:
22: SimpleResponse response = new SimpleResponse();
23: response.setMaxAge(0);
24: response.setContent(pageData.getContent());
25:
26: return response;
27: }
28:
29: public SecureOperation getSecureOperation() {
30: return new SecureReadOperation();
31: }
32: }
|