Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C3843200C5E for ; Tue, 14 Mar 2017 18:34:43 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id C23CE160B7E; Tue, 14 Mar 2017 17:34:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C2EAA160B93 for ; Tue, 14 Mar 2017 18:34:42 +0100 (CET) Received: (qmail 85470 invoked by uid 500); 14 Mar 2017 17:34:41 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 85123 invoked by uid 99); 14 Mar 2017 17:34:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Mar 2017 17:34:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C8141E001D; Tue, 14 Mar 2017 17:34:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Tue, 14 Mar 2017 17:34:45 -0000 Message-Id: In-Reply-To: <0febf293dac84f4fbe80a2fa68d1a49c@git.apache.org> References: <0febf293dac84f4fbe80a2fa68d1a49c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/10] camel git commit: CAMEL-10791-review adjustment archived-at: Tue, 14 Mar 2017 17:34:44 -0000 CAMEL-10791-review adjustment Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/06e0527c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/06e0527c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/06e0527c Branch: refs/heads/master Commit: 06e0527c2a024bacd617af0b3fbe111018dbda08 Parents: 928cdb1 Author: onders86 Authored: Tue Mar 14 07:55:26 2017 +0300 Committer: Claus Ibsen Committed: Tue Mar 14 18:29:38 2017 +0100 ---------------------------------------------------------------------- .../zipfile/ZipFileDataFormatTest.java | 24 ++++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/06e0527c/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileDataFormatTest.java ---------------------------------------------------------------------- diff --git a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileDataFormatTest.java b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileDataFormatTest.java index 6afac67..caf71dc 100644 --- a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileDataFormatTest.java +++ b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipFileDataFormatTest.java @@ -120,7 +120,7 @@ public class ZipFileDataFormatTest extends CamelTestSupport { zip.setSupportEmptyDirectory(true); template.sendBody("direct:unzipWithEmptyDirectory", new File("src/test/resources/hello.odt")); assertTrue(Files.exists(Paths.get("hello_out/Configurations2"))); - //deleteDirectory(new File("hello_out")); + deleteDirectory(new File("hello_out")); } @Test @@ -130,7 +130,7 @@ public class ZipFileDataFormatTest extends CamelTestSupport { zip.setSupportEmptyDirectory(false); template.sendBody("direct:unzipWithEmptyDirectory", new File("src/test/resources/hello.odt")); assertTrue(!Files.exists(Paths.get("hello_out/Configurations2"))); - //deleteDirectory(new File("hello_out")); + deleteDirectory(new File("hello_out")); } @Test @@ -229,21 +229,15 @@ public class ZipFileDataFormatTest extends CamelTestSupport { } } - private static void copy(File file, OutputStream out) throws IOException { - InputStream in = new FileInputStream(file); - try { - copy(in, out); - } finally { - in.close(); - } + private static void copy(File file, OutputStream out) throws IOException { + try (InputStream in = new FileInputStream(file)) { + copy(in, out); + } } - private static void copy(InputStream in, File file) throws IOException { - OutputStream out = new FileOutputStream(file); - try { - copy(in, out); - } finally { - out.close(); + private static void copy(InputStream in, File file) throws IOException { + try (OutputStream out = new FileOutputStream(file)) { + copy(in, out); } }