reading xml file inside a jar-package

后端 未结 4 585
悲哀的现实
悲哀的现实 2020-12-06 19:10

Here\'s my structure:

  • com/mycompany/ValueReader.class
  • com/mycompany/resources/values.xml

I can read the file in my Eclipse project, but

4条回答
  •  温柔的废话
    2020-12-06 19:46

    You can extract the jar then take what you want, in the same class-path using :

        ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new   
    FileInputStream(zipfile.getCanonicalFile())));
    

提交回复
热议问题