set content type

git-svn-id: http://jclouds.googlecode.com/svn/trunk@416 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-05-05 20:51:47 +00:00
parent f854f1fa40
commit c20e124dad
1 changed files with 4 additions and 3 deletions

View File

@ -55,15 +55,16 @@ public class JCloudsServlet extends HttpServlet {
protected void doGet(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) throws ServletException,
IOException {
httpServletResponse.setContentType("text/plain");
Writer writer = httpServletResponse.getWriter();
try {
List<S3Bucket> myBuckets = context.getConnection().getBuckets()
.get(10, TimeUnit.SECONDS);
writer.write("List:\n");
for (S3Bucket bucket : myBuckets) {
writer.write(String.format(" %1s: %2s entries%n", bucket
.getName(), context.createInputStreamMap(bucket)
.size()));
writer.write(String
.format(" %1s: %2s entries%n", bucket.getName(),
context.createInputStreamMap(bucket).size()));
}
} catch (Exception e) {
throw new ServletException(e);