R
Rhino
Given a jar that contains entries representing files (as opposed to
directories), is it possible to add new file entries to the jar or to remove
(permanently delete) entries from the jar *programmatically*? (I know that I
can add files to a jar via the jar -u option on the command line.)
I want my program to be able to add and remove files from a jar but it's
beginning to look like the only way I can accomplish deletions is to make a
new copy of the jar and copy over everything but the file that is to be
deleted, then replace the old jar with the new one. And I may have to use
runtime.exec() to add a new file programmatically. Both options are pretty
ugly but I don't see anything useful in the API, like add() or delete()
methods in either the JarFile or JarEntry classes.
Am I missing something? If yes, please tell me the basic approach to
adding/deleting jar entries.
--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare
directories), is it possible to add new file entries to the jar or to remove
(permanently delete) entries from the jar *programmatically*? (I know that I
can add files to a jar via the jar -u option on the command line.)
I want my program to be able to add and remove files from a jar but it's
beginning to look like the only way I can accomplish deletions is to make a
new copy of the jar and copy over everything but the file that is to be
deleted, then replace the old jar with the new one. And I may have to use
runtime.exec() to add a new file programmatically. Both options are pretty
ugly but I don't see anything useful in the API, like add() or delete()
methods in either the JarFile or JarEntry classes.
Am I missing something? If yes, please tell me the basic approach to
adding/deleting jar entries.
--
Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare