由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - How to delete an entry in JAR?
相关主题
我自己编了个Java面试题Java处理XML
Re: [转载] Re: .jar文件是怎么产生的?how to open .jar file
请问关于 Java XML processingClasspath questions
Open Jarsoap binding with CXF
Java XML parser的问题[转载] 有用Eclipse的嘛?
[转载] a question on XML parserjava virtual machine 急问!!在线等
哪位能大概介绍一下XML的那些APIA good way to compress client side data?
新手问一个:如何找.jar文件里都有什么class?encrypt the compressed file
相关话题的讨论汇总
话题: jar话题: file话题: delete话题: winzip话题: entry
进入Java版参与讨论
1 (共1页)
F****n
发帖数: 3271
1
Believe it or not, this is incrediably difficult in Java. The only solution I
found is to copy the whole file, which is so stupid.
c**g
发帖数: 274
2
I think you can somehow use the manifest-file, not sure never did this.

【在 F****n 的大作中提到】
: Believe it or not, this is incrediably difficult in Java. The only solution I
: found is to copy the whole file, which is so stupid.

st
发帖数: 1685
3
what do you mean? it's just a zip file.. delete what entry?

【在 F****n 的大作中提到】
: Believe it or not, this is incrediably difficult in Java. The only solution I
: found is to copy the whole file, which is so stupid.

F****n
发帖数: 3271
4
An entry is a file or folder in a zip file. Seems it is impossible to append,
modify or delete the content of a zip except create a new copy of the whole
file.

solution I

【在 st 的大作中提到】
: what do you mean? it's just a zip file.. delete what entry?
st
发帖数: 1685
5
well, some will allow the operation, but actually create new file for you...
what ever... zip is not for edit....

【在 F****n 的大作中提到】
: An entry is a file or folder in a zip file. Seems it is impossible to append,
: modify or delete the content of a zip except create a new copy of the whole
: file.
:
: solution I

F****n
发帖数: 3271
6

So why you can add / delete files using winzip?
append,
whole

【在 st 的大作中提到】
: well, some will allow the operation, but actually create new file for you...
: what ever... zip is not for edit....

st
发帖数: 1685
7
I think winzip uncompress file and compress them back.
btw, jar can be compressed or uncompressed, compressed format is just zip,
(some software might create weird zip), you can associate .jar with winzip,
or rename the file to .zip.

【在 F****n 的大作中提到】
:
: So why you can add / delete files using winzip?
: append,
: whole

e***g
发帖数: 158
8
i'll take your word for it, and try to justify that it's not so stupid.
however if it turns out that jar API does do it, then it's your fault:)
if you want to remove one node from an XML file, and you want to use the
'ellegantly designed user friendly' DOM/SAX API, you have to read the whole
thing, change the structure in memory/on the fly, and serialize it to a
new file.
so same thing here for jar. the API is designed to be source/target
agnostic, it does not (want to) concern itself with featu

【在 F****n 的大作中提到】
: Believe it or not, this is incrediably difficult in Java. The only solution I
: found is to copy the whole file, which is so stupid.

st
发帖数: 1685
9
that's not his point, at all.

【在 e***g 的大作中提到】
: i'll take your word for it, and try to justify that it's not so stupid.
: however if it turns out that jar API does do it, then it's your fault:)
: if you want to remove one node from an XML file, and you want to use the
: 'ellegantly designed user friendly' DOM/SAX API, you have to read the whole
: thing, change the structure in memory/on the fly, and serialize it to a
: new file.
: so same thing here for jar. the API is designed to be source/target
: agnostic, it does not (want to) concern itself with featu

xt
发帖数: 17532
10

I
Try,
1) winzip, if you are deleting an entry without programming;
2) java.util.zip

【在 F****n 的大作中提到】
: Believe it or not, this is incrediably difficult in Java. The only solution I
: found is to copy the whole file, which is so stupid.

相关主题
[转载] a question on XML parserJava处理XML
哪位能大概介绍一下XML的那些APIhow to open .jar file
新手问一个:如何找.jar文件里都有什么class?Classpath questions
进入Java版参与讨论
xt
发帖数: 17532
11

append,
Now you make me wonder if you really a Computer Skience major. hehe

【在 F****n 的大作中提到】
: An entry is a file or folder in a zip file. Seems it is impossible to append,
: modify or delete the content of a zip except create a new copy of the whole
: file.
:
: solution I

F****n
发帖数: 3271
12
You must be kidding, you mean if I have a 100mb zip file (it is usual in many
case) and I want to add or delete one file from it, I need to copy the whole
100mb content? That's ridiculous.

you...

【在 st 的大作中提到】
: I think winzip uncompress file and compress them back.
: btw, jar can be compressed or uncompressed, compressed format is just zip,
: (some software might create weird zip), you can associate .jar with winzip,
: or rename the file to .zip.

st
发帖数: 1685
13
try it with winzip, I saw the temp file created there.. with similar
size.. so if you want to do that on a 100mb zip, winzip would do such
stupid thing for you. it's ridiculous but I am not kidding.

【在 F****n 的大作中提到】
: You must be kidding, you mean if I have a 100mb zip file (it is usual in many
: case) and I want to add or delete one file from it, I need to copy the whole
: 100mb content? That's ridiculous.
:
: you...

F****n
发帖数: 3271
14
Both of your points doesnot make since. At least up to JDK1.4.2, it is
impossible using java.util.zip. I am not kidding, probably my experience with
this package is much more than most people on this board.

solution

【在 xt 的大作中提到】
:
: append,
: Now you make me wonder if you really a Computer Skience major. hehe

B******N
发帖数: 445
15
why impossible?

with

【在 F****n 的大作中提到】
: Both of your points doesnot make since. At least up to JDK1.4.2, it is
: impossible using java.util.zip. I am not kidding, probably my experience with
: this package is much more than most people on this board.
:
: solution

F****n
发帖数: 3271
16
Look at the API yourself.

【在 B******N 的大作中提到】
: why impossible?
:
: with

B******N
发帖数: 445
17
i am about to use it today or tomorrow.

【在 F****n 的大作中提到】
: Look at the API yourself.
F****n
发帖数: 3271
18
If you just need to read or copy it, its OK,
otherwise, you have to use the stupid techniques I have used.

experience

【在 B******N 的大作中提到】
: i am about to use it today or tomorrow.
1 (共1页)
进入Java版参与讨论
相关主题
encrypt the compressed fileJava XML parser的问题
Re: JTextArea的内容不滚动[转载] a question on XML parser
Re: How to let two JFrame contact each other?哪位能大概介绍一下XML的那些API
Re: Where can i find this package?新手问一个:如何找.jar文件里都有什么class?
我自己编了个Java面试题Java处理XML
Re: [转载] Re: .jar文件是怎么产生的?how to open .jar file
请问关于 Java XML processingClasspath questions
Open Jarsoap binding with CXF
相关话题的讨论汇总
话题: jar话题: file话题: delete话题: winzip话题: entry