package st.extreme.jython; import java.io.InputStream; import java.net.URL; public class TESTResource { private static URL url; private static InputStream is; public static void main(String[] args) { String name = "/st/extreme/jython/my.resource"; is = TESTResource.class.getResourceAsStream(name); url = TESTResource.class.getResource(name); if (url == null && is == null) { throw new RuntimeException("both resource url and stream are null"); } else { if (url == null) { throw new RuntimeException("resource url is null"); } if (is == null) { throw new RuntimeException("resource stream is null"); } } } }