@Test public void testGetWorkflowLibararies_withoutJars() { File folder = new File("src/test/resources/org/springframework/data/hadoop/admin/util/testWithoutJars"); URL urls[] = HadoopWorkflowUtils.getWorkflowLibararies(folder); Assert.assertNull(urls); }
public static URL[] getWorkflowLibararies(File workflowArtifactFolder) { if (!workflowArtifactFolder.exists()) { return null; } List<URL> result = new ArrayList<URL>(); File[] jarFiles = workflowArtifactFolder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".jar"); } }); if (jarFiles != null && jarFiles.length > 0) { for (File jarFile : jarFiles) { try { result.add(new URL("jar:file:" + jarFile.getAbsolutePath() + "!/")); } catch (MalformedURLException e) { logger.warn("invalid uploaded jar"); } } } logger.info("HadoopWorkflowUtils::getWorkflowLibararies, number of jar:" + result.size()); return result.toArray(new URL[0]); }
HadoopWorkflowUtils { public static URL[] getWorkflowLibararies(File workflowArtifactFolder) { if (!workflowArtifactFolder.exists()) { return null; } List<URL> result = new ArrayList<URL>(); File[] jarFiles = workflowArtifactFolder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".jar"); } }); if (jarFiles != null && jarFiles.length > 0) { for (File jarFile : jarFiles) { try { result.add(new URL("jar:file:" + jarFile.getAbsolutePath() + "!/")); } catch (MalformedURLException e) { logger.warn("invalid uploaded jar"); } } } logger.info("HadoopWorkflowUtils::getWorkflowLibararies, number of jar:" + result.size()); return result.toArray(new URL[0]); } }
HadoopWorkflowUtils { public static URL[] getWorkflowLibararies(File workflowArtifactFolder) { if (!workflowArtifactFolder.exists()) { return null; } List<URL> result = new ArrayList<URL>(); File[] jarFiles = workflowArtifactFolder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".jar"); } }); if (jarFiles != null && jarFiles.length > 0) { for (File jarFile : jarFiles) { try { result.add(new URL("jar:file:" + jarFile.getAbsolutePath() + "!/")); } catch (MalformedURLException e) { logger.warn("invalid uploaded jar"); } } } logger.info("HadoopWorkflowUtils::getWorkflowLibararies, number of jar:" + result.size()); return result.toArray(new URL[0]); }  }
HadoopWorkflowUtils { public static URL[] getWorkflowLibararies(File workflowArtifactFolder) { if (!workflowArtifactFolder.exists()) { return null; } List<URL> result = new ArrayList<URL>(); File[] jarFiles = workflowArtifactFolder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".jar"); } }); if (jarFiles != null && jarFiles.length > 0) { for (File jarFile : jarFiles) { try { result.add(new URL("jar:file:" + jarFile.getAbsolutePath() + "!/")); } catch (MalformedURLException e) { logger.warn("invalid uploaded jar"); } } } logger.info("HadoopWorkflowUtils::getWorkflowLibararies, number of jar:" + result.size()); return result.toArray(new URL[0]); }  static WorkflowArtifacts getWorkflowArtifacts(File workflowArtifactFolder); static String[] getWorkflowDescriptor(File workflowArtifactFolder); static boolean isValidWorkflow(List<FileInfo> files); static URL[] getWorkflowLibararies(File workflowArtifactFolder); static ClassLoader getWorkflowClassLoader(File workflowArtifactFolder); static boolean isSpringBatchJob(ApplicationContext context, WorkflowArtifacts artifacts); static void createAndRegisterSpringBatchJob(ApplicationContext context, final WorkflowArtifacts artifacts); static String generateSpringBatchJobName(final WorkflowArtifacts artifacts); static void unregisterSpringBatchJob(ApplicationContext context, String springBatchJobName); static String getWorkflowDescriptor(final WorkflowArtifacts artifacts); static void processAndRegisterWorkflow(File parentFolder, ApplicationContext context); static WorkflowArtifacts processUploadedFile(final File parentFolder); static void registerSpringBatchJob(WorkflowArtifacts artifacts, ApplicationContext context); }
HadoopWorkflowUtils { public static URL[] getWorkflowLibararies(File workflowArtifactFolder) { if (!workflowArtifactFolder.exists()) { return null; } List<URL> result = new ArrayList<URL>(); File[] jarFiles = workflowArtifactFolder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.toLowerCase().endsWith(".jar"); } }); if (jarFiles != null && jarFiles.length > 0) { for (File jarFile : jarFiles) { try { result.add(new URL("jar:file:" + jarFile.getAbsolutePath() + "!/")); } catch (MalformedURLException e) { logger.warn("invalid uploaded jar"); } } } logger.info("HadoopWorkflowUtils::getWorkflowLibararies, number of jar:" + result.size()); return result.toArray(new URL[0]); }  static WorkflowArtifacts getWorkflowArtifacts(File workflowArtifactFolder); static String[] getWorkflowDescriptor(File workflowArtifactFolder); static boolean isValidWorkflow(List<FileInfo> files); static URL[] getWorkflowLibararies(File workflowArtifactFolder); static ClassLoader getWorkflowClassLoader(File workflowArtifactFolder); static boolean isSpringBatchJob(ApplicationContext context, WorkflowArtifacts artifacts); static void createAndRegisterSpringBatchJob(ApplicationContext context, final WorkflowArtifacts artifacts); static String generateSpringBatchJobName(final WorkflowArtifacts artifacts); static void unregisterSpringBatchJob(ApplicationContext context, String springBatchJobName); static String getWorkflowDescriptor(final WorkflowArtifacts artifacts); static void processAndRegisterWorkflow(File parentFolder, ApplicationContext context); static WorkflowArtifacts processUploadedFile(final File parentFolder); static void registerSpringBatchJob(WorkflowArtifacts artifacts, ApplicationContext context); static String fileURLPrefix; static String springHadoopJobPrefix; static String springHadoopTaskName; }