读取classpath里的文件

URL = new URL(this.getClass().getClassLoader().getResource("com/mycompany/data/images/1234.gif"));
InputStream is = this.getClass().getClassLoader().getResourceAsStream("com/mycompany/data/images/1234.gif"));

你可能感兴趣的:(classpath)