How can an app use files inside the JAR for read and write?

前端 未结 5 835
别那么骄傲
别那么骄傲 2020-11-21 23:09

I need to store data into files inside .jar file and read it again.

I know that I can use Class.getResourceAsStream() method but it returns an Inp

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 00:10

    It is unlikely that you can change a loaded jar safely. Changing it while it is being used is not a good idea.

    If you want to do this, use a plain file system directory and add/remove files from it. Even this may not work as you expect.

提交回复
热议问题