Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Configuration conf = context.getConfiguration();
String file = conf.get("my.own.file", "hdfs://file.xml");
Path path = new Path(file);
FileSystem fs = FileSystem.get(conf);
BufferedReader bread = new BufferedReader(new InputStreamReader(fs.open(path)));
StringBuilder sb = new StringBuilder();
String line = bread.readLine();
while (line != null) {
sb.append(line).append("\n");
line = bread.readLine();
}
String xml = sb.toString();