Read Configuration From ClassPath – JAVA

import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Test;

  * @author David King<br />
public class TransformerTest {
private Logger log = Logger.getLogger(TransformerTest.class.getName());
public void testReadConfigFileFromClasspath() {
 String mappingStream = "com/davidking/transform/user.json";
 InputStreamReader reader
 = new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(mappingStream));
log.log(Level.INFO, "Transformer mapping is: {0}", reader);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s