JarFile from inside a *.jar or inputstream to file?

后端 未结 4 1614
再見小時候
再見小時候 2021-01-13 23:02

I have a jar or war.

I\'m programmaticaly reading this jar, and when I find jar inside this jar I\'d like to programmaticaly read it again.

But JarFile prov

4条回答
  •  臣服心动
    2021-01-13 23:29

    you can create jar file in File System, something like

     File tempFile=TempFile.createFile("newJar",".jar");
    

    and write Stream into it. After that you can construct your JarFile(tempFile) and handle it...

    Forget about it if program is running as unsigned applet/JNLP since you will not have right to create file in file system...

提交回复
热议问题