Configuration conf = new Configuration(); conf.addResource(new Path("/path/to/core-site.xml"));
Configuration conf = new Configuration(); conf.addResource("hdfs-site.xml");
Configuration conf = new Configuration(); conf.addResource("myconfig.xml");This example adds a custom configuration file named "myconfig.xml" to the Configuration object. The file is assumed to be in the same package as the class that is creating the Configuration object. All of these examples make use of the org.apache.hadoop.conf.Configuration class from the Apache Hadoop libraries. This package is typically found in the hadoop-core JAR file.