Here you can find the source of getResourceReader(final String aResName)
Parameter | Description |
---|---|
aResName | The resource to fetch. |
public static Reader getResourceReader(final String aResName)
//package com.java2s; //License from project: BSD License import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; public class Main { /**//from w w w . jav a 2 s . c o m * Loads a resource from the classpath. * * @param aResName * The resource to fetch. * @return A handle for the resource or null if the resource is not found. */ public static Reader getResourceReader(final String aResName) { final InputStream resource = getResource(aResName); if (resource == null) { return null; } return new InputStreamReader(resource); } /** * Loads a resource from the classpath. * * @param aResName * The resource to fetch. * @return A handle for the resource or null if the resource is not found. */ public static InputStream getResource(final String aResName) { return Thread.currentThread().getContextClassLoader().getResourceAsStream(aResName); } }