Permalink
Browse files

Removing the previous change since HttpServlet should close itself.

  • Loading branch information...
1 parent 386d318 commit 00114cbdae7cc34c6f35ff6396043213654d10f0 @rbpark committed Mar 21, 2012
Showing with 13 additions and 24 deletions.
  1. +13 −24 azkaban/src/java/azkaban/web/pages/HdfsBrowserServlet.java
@@ -251,32 +251,21 @@ private void displayFile(FileSystem fs, HttpServletRequest req, HttpServletRespo
// use registered viewers to show the file content
boolean outputed = false;
- OutputStream output = null;
-
- try {
- output = resp.getOutputStream();
- for(HdfsFileViewer viewer: _viewers) {
- if(viewer.canReadFile(fs, path)) {
- viewer.displayFile(fs, path, output, startLine, endLine);
- outputed = true;
- break; // don't need to try other viewers
- }
+ OutputStream output = resp.getOutputStream();
+ for(HdfsFileViewer viewer: _viewers) {
+ if(viewer.canReadFile(fs, path)) {
+ viewer.displayFile(fs, path, output, startLine, endLine);
+ outputed = true;
+ break; // don't need to try other viewers
}
-
- // use default text viewer
- if(!outputed) {
- if(_defaultViewer.canReadFile(fs, path)) {
- _defaultViewer.displayFile(fs, path, output, startLine, endLine);
- } else {
- output.write(("Sorry, no viewer available for this file. ").getBytes("UTF-8"));
- }
- }
- } catch (IOException e) {
- throw e;
}
- finally {
- if (output != null) {
- output.close();
+
+ // use default text viewer
+ if(!outputed) {
+ if(_defaultViewer.canReadFile(fs, path)) {
+ _defaultViewer.displayFile(fs, path, output, startLine, endLine);
+ } else {
+ output.write(("Sorry, no viewer available for this file. ").getBytes("UTF-8"));
}
}
}

0 comments on commit 00114cb

Please sign in to comment.