@Test public void testGetConnectorJarsNonNullPath() { String path = workingDir + "/src/test/resources"; Set<File> files = ConnectorManagerUtils.getConnectorJars(path); assertEquals(1, files.size()); }
public static Set<File> getConnectorJars(String path) { if (StringUtils.isEmpty(path)) { return null; } Set<File> jarFiles = new HashSet<File>(); File folder = new File(path); if (folder.exists()) { for (File file : folder.listFiles()) { if (file.isDirectory()) { jarFiles.addAll(getConnectorJars(file.getPath())); } if (file.getName().endsWith(".jar") && isConnectorJar(file)) { jarFiles.add(file); } } } return jarFiles; }
ConnectorManagerUtils { public static Set<File> getConnectorJars(String path) { if (StringUtils.isEmpty(path)) { return null; } Set<File> jarFiles = new HashSet<File>(); File folder = new File(path); if (folder.exists()) { for (File file : folder.listFiles()) { if (file.isDirectory()) { jarFiles.addAll(getConnectorJars(file.getPath())); } if (file.getName().endsWith(".jar") && isConnectorJar(file)) { jarFiles.add(file); } } } return jarFiles; } }
ConnectorManagerUtils { public static Set<File> getConnectorJars(String path) { if (StringUtils.isEmpty(path)) { return null; } Set<File> jarFiles = new HashSet<File>(); File folder = new File(path); if (folder.exists()) { for (File file : folder.listFiles()) { if (file.isDirectory()) { jarFiles.addAll(getConnectorJars(file.getPath())); } if (file.getName().endsWith(".jar") && isConnectorJar(file)) { jarFiles.add(file); } } } return jarFiles; }  }
ConnectorManagerUtils { public static Set<File> getConnectorJars(String path) { if (StringUtils.isEmpty(path)) { return null; } Set<File> jarFiles = new HashSet<File>(); File folder = new File(path); if (folder.exists()) { for (File file : folder.listFiles()) { if (file.isDirectory()) { jarFiles.addAll(getConnectorJars(file.getPath())); } if (file.getName().endsWith(".jar") && isConnectorJar(file)) { jarFiles.add(file); } } } return jarFiles; }  static List<URL> getConnectorConfigs(); static Set<File> getConnectorJars(String path); static void addExternalConnectorsJarsToClasspath(String path); }
ConnectorManagerUtils { public static Set<File> getConnectorJars(String path) { if (StringUtils.isEmpty(path)) { return null; } Set<File> jarFiles = new HashSet<File>(); File folder = new File(path); if (folder.exists()) { for (File file : folder.listFiles()) { if (file.isDirectory()) { jarFiles.addAll(getConnectorJars(file.getPath())); } if (file.getName().endsWith(".jar") && isConnectorJar(file)) { jarFiles.add(file); } } } return jarFiles; }  static List<URL> getConnectorConfigs(); static Set<File> getConnectorJars(String path); static void addExternalConnectorsJarsToClasspath(String path);  }