/** * Loads the configuration file for the application, if it exists. This is either the * user-specified properties file, or the spark-defaults.conf file under the Spark configuration * directory. */ private Properties loadPropertiesFile() throws IOException { Properties props = new Properties(); File propsFile; if (propertiesFile != null) { propsFile = new File(propertiesFile); checkArgument(propsFile.isFile(), "Invalid properties file '%s'.", propertiesFile); } else { propsFile = new File(getConfDir(), DEFAULT_PROPERTIES_FILE); } if (propsFile.isFile()) { try (InputStreamReader isr = new InputStreamReader( new FileInputStream(propsFile), StandardCharsets.UTF_8)) { props.load(isr); for (Map.Entry<Object, Object> e : props.entrySet()) { e.setValue(e.getValue().toString().trim()); } } } return props; }
/** * Loads the configuration file for the application, if it exists. This is either the * user-specified properties file, or the spark-defaults.conf file under the Spark configuration * directory. */ private Properties loadPropertiesFile() throws IOException { Properties props = new Properties(); File propsFile; if (propertiesFile != null) { propsFile = new File(propertiesFile); checkArgument(propsFile.isFile(), "Invalid properties file '%s'.", propertiesFile); } else { propsFile = new File(getConfDir(), DEFAULT_PROPERTIES_FILE); } if (propsFile.isFile()) { try (InputStreamReader isr = new InputStreamReader( new FileInputStream(propsFile), StandardCharsets.UTF_8)) { props.load(isr); for (Map.Entry<Object, Object> e : props.entrySet()) { e.setValue(e.getValue().toString().trim()); } } } return props; }
checkArgument(propsFile.isFile(), "Invalid properties file '%s'.", propertiesFile); } else { propsFile = new File(getConfDir(), DEFAULT_PROPERTIES_FILE);
checkArgument(propsFile.isFile(), "Invalid properties file '%s'.", propertiesFile); } else { propsFile = new File(getConfDir(), DEFAULT_PROPERTIES_FILE);
File javaOpts = new File(join(File.separator, getConfDir(), "java-opts")); if (javaOpts.isFile()) { try (BufferedReader br = new BufferedReader(new InputStreamReader(
File javaOpts = new File(join(File.separator, getConfDir(), "java-opts")); if (javaOpts.isFile()) { try (BufferedReader br = new BufferedReader(new InputStreamReader(
File javaOpts = new File(join(File.separator, getConfDir(), "java-opts")); if (javaOpts.isFile()) { BufferedReader br = new BufferedReader(new InputStreamReader(
File javaOpts = new File(join(File.separator, getConfDir(), "java-opts")); if (javaOpts.isFile()) { try (BufferedReader br = new BufferedReader(new InputStreamReader(
addToClassPath(cp, appClassPath); addToClassPath(cp, getConfDir());
addToClassPath(cp, appClassPath); addToClassPath(cp, getConfDir());
addToClassPath(cp, appClassPath); addToClassPath(cp, getConfDir());
addToClassPath(cp, appClassPath); addToClassPath(cp, getConfDir());