mirror of https://github.com/apache/jclouds.git
set content type
git-svn-id: http://jclouds.googlecode.com/svn/trunk@416 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
parent
f854f1fa40
commit
c20e124dad
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue