keith-turner commented on a change in pull request #985: Closed file system
which is not eventually closed.
URL: https://github.com/apache/fluo/pull/985#discussion_r158551422
##########
File path:
modules/command/src/main/java/org/apache/fluo/command/FluoGetJars.java
##########
@@ -65,12 +65,13 @@ public static void main(String[] args) {
try {
if (config.getObserverJarsUrl().startsWith("hdfs://")) {
- FileSystem fs = FileSystem.get(new URI(config.getDfsRoot()), new
Configuration());
- File downloadPathFile = new File(opts.getDownloadPath());
- if (downloadPathFile.exists()) {
- FileUtils.deleteDirectory(downloadPathFile);
+ try (FileSystem fs = FileSystem.get(new URI(config.getDfsRoot()), new
Configuration())) {
+ File downloadPathFile = new File(opts.getDownloadPath());
+ if (downloadPathFile.exists()) {
+ FileUtils.deleteDirectory(downloadPathFile);
+ }
+ fs.copyToLocalFile(new Path(config.getObserverJarsUrl()), new
Path(opts.getDownloadPath()));
Review comment:
I built and tested this locally, I noticed this line was reformatted. Fluo
uses Maven plugins to automatically format the code. If you run `mvn compile`
locally you should see that this line is reformatted.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services