This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 279ebf0f8a0470e46975d2212160e82e2194b88e Author: Gary Gregory <[email protected]> AuthorDate: Mon Jan 9 22:36:11 2023 -0500 Format --- .../java/org/apache/commons/compress/AbstractTestCase.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/apache/commons/compress/AbstractTestCase.java b/src/test/java/org/apache/commons/compress/AbstractTestCase.java index 593a484d..719920c8 100644 --- a/src/test/java/org/apache/commons/compress/AbstractTestCase.java +++ b/src/test/java/org/apache/commons/compress/AbstractTestCase.java @@ -49,6 +49,7 @@ public abstract class AbstractTestCase { protected interface StreamWrapper<I extends InputStream> { I wrap(InputStream in) throws Exception; } + private static final boolean ON_WINDOWS = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows"); @@ -65,6 +66,7 @@ public abstract class AbstractTestCase { } return new File(uri); } + public static Path getPath(final String path) throws IOException { return getFile(path).toPath(); } @@ -78,18 +80,18 @@ public abstract class AbstractTestCase { if (s != null) { for (final String element : s) { final File file = new File(f, element); - if (file.isDirectory()){ + if (file.isDirectory()) { rmdir(file); } final boolean ok = tryHardToDelete(file); - if (!ok && file.exists()){ - System.out.println("Failed to delete "+element+" in "+f.getPath()); + if (!ok && file.exists()) { + System.out.println("Failed to delete " + element + " in " + f.getPath()); } } } tryHardToDelete(f); // safer to delete and check - if (f.exists()){ - throw new Error("Failed to delete "+f.getPath()); + if (f.exists()) { + throw new Error("Failed to delete " + f.getPath()); } } @@ -401,7 +403,7 @@ public abstract class AbstractTestCase { dir = resultDir = null; if (!tryHardToDelete(archive)) { // Note: this exception won't be shown if the test has already failed - throw new Exception("Could not delete "+archive.getPath()); + throw new Exception("Could not delete " + archive.getPath()); } } }
