Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

The subject of this question is this Stack Overflow question, "Uncompressing a ZIP file in memory in Java".

The question was closed for being not constructive. I disagree with both that classification, and with closing the question for any reason at all.

My own view is this: the question is an objective, "Yes, this one/No" kind of question, whose topic -- Java libraries -- is properly within the scope of Stack Overflow -- this answer, for instance, may well be an acceptable answer (I just haven't had time to test it yet). Also, there's nothing in its wording, that I can see, to attract the heat that, unfortunately, it did.

Furthermore, it is a very real question; if I can't find an answer, I'll either have to write by own ZIP decoder, or take on a risk with very high penalties -- up to losing my job.

The problem that resulted in the question being closed, as far as I'm able to tell, is that many people, through both comments and answers, have been trying to circumvent my requirements so that the class I want an alternative for, ZipInputStream, becomes a valid answer.

Personally, I think closing the question is rewarding trolls, as, to my eyes, the question was closed not because of anything in the question itself but, rather, because of things some other people wrote in response, while avoiding the question itself.

So, the question is: is the question valid because of its merits, should it be closed because of the bad behavior it attracted, or should it be closed for some other reason I failed to see?

share|improve this question
I see the merits of both sides here, but opted to vote to reopen (and it's now open again). – joran Sep 13 '12 at 2:32
I don't think anyone was trying to circumvent your requirements - they were trying to better understand them. For example, the question still talks about entries being optional, despite the fact that it looks like that's not the case - you're trying to solve a different potential weak spot in ZipInputStream, where the entries just aren't contiguous. Having "the answer must not use ZipInputStream" as an axiom isn't helpful, IMO. – Jon Skeet Sep 13 '12 at 2:43
I'm glad the question was reopened. – Seth Tisue Sep 13 '12 at 2:46
The majority of your question is pretext for this: "So... are there alternative Java libraries that will solve this problem for me?" - that's a shopping list question, and those are closed as "Not Constructive". Also, please leave the meta dialog out of the question. – casperOne Sep 13 '12 at 3:30
@casperOne Sorry, I don't understand what you mean by meta dialog. Could you explain that to me? Also, it is a shopping list question, but I don't see the policy forbidding it. Could you please indicate which it is? Tools questions are explicitly accepted in the FAQ, and my question is related to a real problem I have. – Daniel C. Sobral Sep 13 '12 at 3:48
@DanielC.Sobral See for why it's Not Constructive. We simply don't do list questions here. As for the meta dialog in your question, the "Guys, let's keep the discussion thread out of it, alright?" is the meta dialog in your question. That shouldn't be in any question at all. You don't talk about the question in the question. – casperOne Sep 13 '12 at 12:08
@casperOne Ah, ok. I beg to disagree. I have clear requisites: that it works properly according to ZIP standards, and that it won't go through the filesystem. But, whatever -- I give up on Stack Overflow. – Daniel C. Sobral Sep 13 '12 at 12:30

There's a number of problems with your question:

I do not yet have access to the zip files I'll be handling, so I don't know whether I'll be able to handle them through the stream...

Unless you can definitively state that there is actually a problem with the mystery zip file then no-one can give you a definitive answer.

Jon's answer pretty much sums this up:

That means you're asking for code which should handle zip files which are invalid in ways you can't even predict. Just how invalid would it have to be for you to be able to reject it? If I give you 1000 random bytes, with no attempt for them to be a zip file at all, what on earth would you do with it?


Basically, you need to pin the problem down more tightly before it's feasible to even say whether a particular library is a valid solution. It's reasonable to collect a set of zip files from various places, which may be invalid in well-understood ways, and say "I must be able to support all of these." Later you may need to do some work if it turns out that wasn't good enough. But to be able to support anything, however broken, simply isn't a valid requirement.

You are asking the community to recommend a library to handle a set of un-specified failure conditions. To be brutal, this is at best a shopping and recommendation question with a vague (to unknown) set of requirements.

It's impossible to answer this question unless we know if there is something wrong with your zip file.

share|improve this answer
I have reworded the question to "uncompress any valid zip file, as per wikipedia's definition". Is that clear enough? I never mentioned uncompressing broken zip files in the question -- I just told Jon on a comment that I'd have to work with whatever file I got, even if they were broken. I'll happily delete all my comments, if you are going to judge the question based on the comments -- which is what I'm complaining about. – Daniel C. Sobral Sep 13 '12 at 3:03
@DanielC.Sobral: The comments are there to clarify the question because it was unclear. Also, Wikipedia should not be used as a primary source for anything. – Nicol Bolas Sep 13 '12 at 3:33
@NicolBolas Stack Overflow is not a primary source for anything either, which doesn't mean it isn't useful. I sure hope you are not questioning wikipedia's usefulness? Pointing people to PKWare's specification would be unhelpful, and, besides, it's linked to from wikipedia. Do you have a specific suggestion to replace the wikipedia reference? I can't think of anything more clear than that. – Daniel C. Sobral Sep 13 '12 at 4:05

I don't think it should be closed as "not constructive"; I think it should be closed as "not a real question". From the comment thread, it seems apparent that you're unclear on exactly what you're looking for and what your specific needs are (which includes why ZipInputStream would not work for you). Until you are clear on what you need and why, any answers would be speculative at best.

share|improve this answer
If I wrote "Something that uncompresses ZIP files correctly according to Wikipedia's definition of ZIP file" would be better? Honestly, I'm quoting two different reasonably authoritative sources on the problems: wikipedia and apache commons -- were they explain the limitations of their own library. Why is that not enough? – Daniel C. Sobral Sep 13 '12 at 2:58
Daniel, one of the problems that stands out to me is that there's a lot of noise in your post. Try eliminating the fluff, and it would make it easier for people to evaluate your question. Posts that have a lot of unnecessary information, like all the "comments" in your question body, support not constructive and not a real question as close reasons. Hope this helps! – jmort253 Sep 13 '12 at 3:42
@jmort253 Thanks for the feedback. I pared down everything I thought I could get away with. Do you still see anything superfluous there? Personally, I think "must read from central directory instead of entry header" should have been enough, but a lot of the comments wanted to know why that was a requirement. – Daniel C. Sobral Sep 13 '12 at 4:33
Hi Daniel, I know there was a lot of controversy surrounding your question, but I'd almost suggest taking that material out of your and focusing solely on the question. If you can make it easier for someone to read, it will be clearer you've done the work to improve it, and it will also read less like what might appear to some as a rant. The key point that I think made it closeable was asking for a library, which is shopping. If you can twist the question to where it's not asking that, I think you'll be fine. :) Good luck! – jmort253 Sep 13 '12 at 4:36
Hi Daniel, I just tried my hand at an edit, removing the part asking for a library and replacing with asking how to solve the problem. It's still broad, but I think it's better to be a little broad than to just ask for a library. The answer can still be a library, but you might also get another answer that doesn't consist of another code library, which you didn't even expect. Hope this helps! If not, feel free to rollback my edit. – jmort253 Sep 13 '12 at 4:41
@jmort253 I saw it. Good edit -- it makes Jon Skeet's answer valid -- though I'm really hoping for a library. Even my ZipInputStream code stumbled upon problems on early sample files (the file size issue I alluded to), so I'd prefer not to rely solely on test cases I can think of to guarantee correctness. Anyway, thanks. – Daniel C. Sobral Sep 13 '12 at 4:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .