Tuesday, 15 April 2014

java - copy contents jar file from another jar file -


Is it possible to copy the content of a jar file to another jar file? I'm talking about creating a clean collection here In the previous jar file, the file data is still intact (I can use it as an archive utility, such as Winrar, but JCK / JRE fails to load it for some reason or other)

< P> I am having difficulty opening the entire jar because my OS considers some files in the case of sensors and trashes when those people are removed.

So I should do it in memory or some other case-sensitive file or collection system like Raar, Tar, 7z or Gunzip, it would be good if the shelf code is closed but I have no problem that I I can do it with grammar too.

Java 7 NIO.2 API (java.nio.file) can easily complete this. This jar file (which is actually the only .zip file) can use it as a filesystem in its own right, and can copy files directly.

See javadoc on java.nio.file. Path and java.nio.file.files, and then look at a cookbook recipe based on those classes.


No comments:

Post a Comment