@Test public void testGetConfWithLocation() throws FileNotFoundException { String name = "sparkJob.properties"; String defaultPath = "/" + name; String location = "src/test/resources"; Properties properties = getConf(name, defaultPath, location); assertNotNull(properties); }
public static Properties getConf(String name, String defaultPath, String location) throws FileNotFoundException { String path = getConfPath(name, location); Resource resource; if (path == null) { resource = new ClassPathResource(defaultPath); path = defaultPath; } else { resource = new InputStreamResource(new FileInputStream(path)); } return getProperties(path, resource); }
PropertiesUtil { public static Properties getConf(String name, String defaultPath, String location) throws FileNotFoundException { String path = getConfPath(name, location); Resource resource; if (path == null) { resource = new ClassPathResource(defaultPath); path = defaultPath; } else { resource = new InputStreamResource(new FileInputStream(path)); } return getProperties(path, resource); } }
PropertiesUtil { public static Properties getConf(String name, String defaultPath, String location) throws FileNotFoundException { String path = getConfPath(name, location); Resource resource; if (path == null) { resource = new ClassPathResource(defaultPath); path = defaultPath; } else { resource = new InputStreamResource(new FileInputStream(path)); } return getProperties(path, resource); }  }
PropertiesUtil { public static Properties getConf(String name, String defaultPath, String location) throws FileNotFoundException { String path = getConfPath(name, location); Resource resource; if (path == null) { resource = new ClassPathResource(defaultPath); path = defaultPath; } else { resource = new InputStreamResource(new FileInputStream(path)); } return getProperties(path, resource); }  static Properties getProperties(String path, Resource resource); static Properties getConf(String name, String defaultPath,
                                     String location); static String getConfPath(String name, String location); }
PropertiesUtil { public static Properties getConf(String name, String defaultPath, String location) throws FileNotFoundException { String path = getConfPath(name, location); Resource resource; if (path == null) { resource = new ClassPathResource(defaultPath); path = defaultPath; } else { resource = new InputStreamResource(new FileInputStream(path)); } return getProperties(path, resource); }  static Properties getProperties(String path, Resource resource); static Properties getConf(String name, String defaultPath,
                                     String location); static String getConfPath(String name, String location);  }