Modify an xml files in a jar file with Java

By : Tim

I currently am tasked with updating an XML file (persistance.xml) within a jar at a customers site. I can of course unjar the file, update the xml, then rejar the file for redeployment. I would like to kind these command line operations in a Swing App so that the person doing it does not have to drop to the command line. Any thoughts on a way to do this programatically?

By : Tim


You can use Java's ZipFile and ZipEntry classes to read the contents of a JAR file, then use ZipOutputStream to create a new one.

Lazy unmount will do the job for you.

unmount -l

umount -f -t cifs -l /mnt &

Be careful of &, let umount run in background. umount will detach filesystem first, so you will find nothing abount /mnt. If you run df command, then it will umount /mnt forcibly.

By : zhjb7

This video can help you solving your question :)
By: admin