FileUtil { public static boolean isJarFile(final File f) { return f.isFile() && f.getPath() .toLowerCase() .endsWith(".jar"); } private  FileUtil(); static boolean configurePermissions(final File f, final boolean executable); static boolean isJarFile(final File f); static Either<Exception, Optional<File>> findFolder(final String folderName); static Stream<URL> filesToUrls(final File... jars);  }
@Test void isJarFile() throws IOException { Path path = Files.createTempFile("robozonky-", ".jar"); assumeThat(path).exists(); File file = path.toFile(); assertThat(FileUtil.isJarFile(file)).isTrue(); file.delete(); assumeThat(FileUtil.isJarFile(file)).isFalse(); }
@Test void negativeIsJarFile() throws IOException { Path path = Files.createTempFile("robozonky-", ".tmp"); assumeThat(path).exists(); File file = path.toFile(); assertThat(FileUtil.isJarFile(file)).isFalse(); file.delete(); assumeThat(FileUtil.isJarFile(file)).isFalse(); }