Death to WinZip
I always thought that Java couldnt read or write WinZip
compatible zip files? Apparently you can.
Im too cheap to pay the $30 extortion fee to unlock WinZip and
WinRAR et al - so this makes me ask: Why hasnt anyone
written a Java un/zipper? Id pay them just to spite WinZip.
Im so happy I dont have to wait anymore for WinZip to vindictively count
to the number of zip files ive used since time began before it lets
me perform an operation.
If anyone wants to make a fancy GUI and get my $30 ill get you started:
import java.io.*;
import java.util.*;
import java.util.zip.*;
publicclass ZipLoader{
publicstaticvoid main(String[] args){
new ZipLoader();
}
public ZipLoader(){
try{
String zipFilename ="zipfile.zip";
ZipFile zipFile =new ZipFile(zipFilename);
Enumeration entries = zipFile.entries();
while(entries.hasMoreElements()){
ZipEntry entry = (ZipEntry)entries.nextElement();
System.out.println("Entry: " + entry);
}
ZipEntry entry = zipFile.getEntry("textfile.txt");
InputStream stream = zipFile.getInputStream(entry);
InputStreamReader streamReader =new InputStreamReader(stream);
BufferedReader reader =new BufferedReader(streamReader);
String line;
while((line = reader.readLine()) !=null){
System.out.println(line);
}
reader.close();
stream.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
You cant use a computer without working with zip files.
Have you seen the WinZip feature list? 99.999 of those features
are completely useless for someone who just has to read and
write files. There is the little known and appreciated XP compressed
file opener. It doesnt write files and im pretty sure they purposely have
it take a ridiculous amount of time to unzip folders - it takes them
forever.
I dont mind a company charging for software. But $30 a year when it
took me 20 lines of code? At least have a $5 option without the
superfluous cd burning, NSA level encryption, blah blah blah.
Im sorry. Im sorry. Ive just really grown to resent that COUNTDOWN
TO YOUR OPERATION popup, lol!
> You cant use a computer without working with zip
> files.
I did so for years...
> Have you seen the WinZip feature list? 99.999 of
> those features
> are completely useless for someone who just has to
> read and
So seek a cheaper alternative, but don't come here whining that those features are there...
> file opener. It doesnt write files and im pretty sure
> they purposely have
> it take a ridiculous amount of time to unzip folders
Ah, it's a conspiracy!
> I dont mind a company charging for software. But $30
> a year when it
Not per year. I paid that money back in 1995 and have been using it ever since.
> took me 20 lines of code? At least have a $5 option
If it's 20 lines of code, you could easily write your own... So go ahead and do it.
And you can then sell it for $5 a pop to all those people who think like you and you should (if you're right) be extremely rich very quick, buy Winzip, and fire everyone there on the spot for their conspiracy to defraud the world.
> You cant use a computer without working with zip
> files.
I can't remember the last time I used zip files at work. We're a *nix house, we deal largely with tars. Even if we did, there's always gzip/gunzip. There are tons of free zip utilities kicking about, too. Plus, as pointed out, there's shell extensions in later versions of Windows. If I recall, WinZip is somewhat quicker than, say, XP compressed folders, though. Worth paying for it for that alone, to some people I guess. If not, there are plenty of alternatives