private static boolean isJavaArchive(Path path) { return ZipUtil.endsWithZipExtension(path.toString()); } }
private static boolean isJavaArchive(Path path) { return ZipUtil.endsWithZipExtension(path.toString()); } }
public static List<String> scanZipFile(String parentPath, InputStream is, boolean relativeOnly) { try { ZipInputStream zis = new ZipInputStream(is); ZipEntry entry; List<String> results = new ArrayList<>(); while ((entry = zis.getNextEntry()) != null) { String fullPath = parentPath + "/" + entry.getName(); results.add(relativeOnly ? entry.getName() : fullPath); if (!entry.isDirectory() && ZipUtil.endsWithZipExtension(entry.getName())) { results.addAll(scanZipFile(fullPath, zis, relativeOnly)); } } return results; } catch (IOException e) { System.err.println("Could not read file: " + parentPath + " due to: " + e.getMessage()); return Collections.emptyList(); } }
public static List<String> scanZipFile(String parentPath, InputStream is, boolean relativeOnly) { try { ZipInputStream zis = new ZipInputStream(is); ZipEntry entry; List<String> results = new ArrayList<>(); while ((entry = zis.getNextEntry()) != null) { String fullPath = parentPath + "/" + entry.getName(); results.add(relativeOnly ? entry.getName() : fullPath); if (!entry.isDirectory() && ZipUtil.endsWithZipExtension(entry.getName())) { results.addAll(scanZipFile(fullPath, zis, relativeOnly)); } } return results; } catch (IOException e) { System.err.println("Could not read file: " + parentPath + " due to: " + e.getMessage()); return Collections.emptyList(); } }
private static List<String> findPaths(Path path, boolean relativeOnly) { List<String> results = new ArrayList<>(); results.add(path.normalize().toAbsolutePath().toString()); if (Files.isDirectory(path)) { try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path)) { for (Path child : directoryStream) { results.addAll(findPaths(child, relativeOnly)); } } catch (IOException e) { System.err.println("Could not read file: " + path + " due to: " + e.getMessage()); } } else if (Files.isRegularFile(path) && ZipUtil.endsWithZipExtension(path.toString())) { results.addAll(ZipUtil.scanZipFile(path, relativeOnly)); } return results; }
private static List<String> findPaths(Path path, boolean relativeOnly) { List<String> results = new ArrayList<>(); results.add(path.normalize().toAbsolutePath().toString()); if (Files.isDirectory(path)) { try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path)) { for (Path child : directoryStream) { results.addAll(findPaths(child, relativeOnly)); } } catch (IOException e) { System.err.println("Could not read file: " + path + " due to: " + e.getMessage()); } } else if (Files.isRegularFile(path) && ZipUtil.endsWithZipExtension(path.toString())) { results.addAll(ZipUtil.scanZipFile(path, relativeOnly)); } return results; }
private static List<String> findPaths(Path path, boolean relativeOnly) { List<String> results = new ArrayList<>(); results.add(path.normalize().toAbsolutePath().toString()); if (Files.isDirectory(path)) { try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path)) { for (Path child : directoryStream) { results.addAll(findPaths(child, relativeOnly)); } } catch (IOException e) { Logger.getLogger(PackageDiscoveryServiceImpl.class).warn("Could not read file: " + path + " due to: " + e.getMessage()); } } else if (Files.isRegularFile(path) && ZipUtil.endsWithZipExtension(path.toString())) { results.addAll(ZipUtil.scanZipFile(path, relativeOnly)); } return results; } }
if (subFile.isFile() && ZipUtil.endsWithZipExtension(subFileModel.getFilePath()))
continue; if (subArchivesOnly && !ZipUtil.endsWithZipExtension(subFile.getAbsolutePath())) continue; event.getGraphContext().commit(); if (subFile.isFile() && ZipUtil.endsWithZipExtension(subFileModel.getFilePath()))
continue; if (subArchivesOnly && !ZipUtil.endsWithZipExtension(subFile.getAbsolutePath())) continue; event.getGraphContext().commit(); if (subFile.isFile() && ZipUtil.endsWithZipExtension(subFileModel.getFilePath()))
projectModel.setDescription("Not available"); if(ZipUtil.endsWithZipExtension(archiveModel.getArchiveName()))
projectModel.setDescription("Not available"); if(ZipUtil.endsWithZipExtension(archiveModel.getArchiveName()))