5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 03:09:57 +08:00

SQOOP-1472: Use Properties.load() method to load property files under conf/manager.d

(Chiwan Park via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-10-21 16:04:22 -07:00
parent 65a9340fc2
commit 0d35911416

View File

@ -218,20 +218,7 @@ private void addManagersFromFile(Configuration conf, File f) {
// The file format is actually Java properties-file syntax.
r = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
Properties props = new Properties();
String line;
while ((line = r.readLine()) != null) {
if ("".equals(line.trim())) {
continue;
}
int separator = line.indexOf('=');
if (separator == -1) {
throw new IOException("the content of connector file must be "
+ "in form of key=value");
}
String key = line.substring(0, separator).trim();
String value = line.substring(separator + 1).trim();
props.setProperty(key, value);
}
props.load(r);
for (Map.Entry<Object, Object> entry : props.entrySet()) {
// Each key is a ManagerFactory class name.