@Test public void testGetConfiguredTemplate() { String templateName = ""; try { FileWriter fileWriter = new FileWriter(tempFile); fileWriter.append("new_command.template=templates/col_new_template_migration.sql"); fileWriter.flush(); fileWriter.close(); templateName = ExternalResources.getConfiguredTemplate(tempFile.getAbsolutePath(), "new_command.template"); assertEquals("templates/col_new_template_migration.sql", templateName); } catch (Exception e) { fail("Test failed with execption: " + e.getMessage()); } }
public static String getConfiguredTemplate(String templatePath, String templateProperty) throws FileNotFoundException { String templateName = ""; Properties migrationProperties = new Properties(); try { migrationProperties.load(new FileInputStream(templatePath)); templateName = migrationProperties.getProperty(templateProperty); } catch (FileNotFoundException e) { throw e; } catch (Exception e) { log.error("", e); } return templateName; }
ExternalResources { public static String getConfiguredTemplate(String templatePath, String templateProperty) throws FileNotFoundException { String templateName = ""; Properties migrationProperties = new Properties(); try { migrationProperties.load(new FileInputStream(templatePath)); templateName = migrationProperties.getProperty(templateProperty); } catch (FileNotFoundException e) { throw e; } catch (Exception e) { log.error("", e); } return templateName; } }
ExternalResources { public static String getConfiguredTemplate(String templatePath, String templateProperty) throws FileNotFoundException { String templateName = ""; Properties migrationProperties = new Properties(); try { migrationProperties.load(new FileInputStream(templatePath)); templateName = migrationProperties.getProperty(templateProperty); } catch (FileNotFoundException e) { throw e; } catch (Exception e) { log.error("", e); } return templateName; } private  ExternalResources(); }
ExternalResources { public static String getConfiguredTemplate(String templatePath, String templateProperty) throws FileNotFoundException { String templateName = ""; Properties migrationProperties = new Properties(); try { migrationProperties.load(new FileInputStream(templatePath)); templateName = migrationProperties.getProperty(templateProperty); } catch (FileNotFoundException e) { throw e; } catch (Exception e) { log.error("", e); } return templateName; } private  ExternalResources(); static void copyExternalResource(File sourceFile, File destFile); static String getConfiguredTemplate(String templatePath, String templateProperty); }
ExternalResources { public static String getConfiguredTemplate(String templatePath, String templateProperty) throws FileNotFoundException { String templateName = ""; Properties migrationProperties = new Properties(); try { migrationProperties.load(new FileInputStream(templatePath)); templateName = migrationProperties.getProperty(templateProperty); } catch (FileNotFoundException e) { throw e; } catch (Exception e) { log.error("", e); } return templateName; } private  ExternalResources(); static void copyExternalResource(File sourceFile, File destFile); static String getConfiguredTemplate(String templatePath, String templateProperty);  }