commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitaliy S" <>
Subject Re: I wrote several methods for IOCommons FileUtil. How can I donate it to IOCommons?
Date Sun, 18 Jun 2006 13:45:46 GMT
Thanks for a link, but my code couldn't be applied to compress. Compress
does nothing with jar.

re:IMO compression is beyond the scope of IO.
Consider this example from
#1: Opening a Text File

In JDK 1.1 to 1.4, in order to open a simple text output file you needed to

FileWriter fout = new FileWriter("fred.txt");
BufferedWriter bout = new BufferedWriter(fout);
PrintWriter pout = new PrintWriter(bout);

Say what? Why are we having to type three "new"s in order to do what should
be a simple operation?

In Tiger we have finally added direct support for the common case and now
you can do:
PrintWriter pout = new PrintWriter("fred.txt");

This is an interesting example of a common glitch in our thinking. In the
Java platform we often like to provide lots of well designed, well separated
components that can be plugged together in interesting ways. In fact some
people might argue be that the design is cleaner if the PrintWriter class
doesn't know anything about files. Well, personally, I don't think so. I
think it is good to provide clean, well separated components, but we also
need to provide simple shortcuts to support the most common use cases.

To me apache commons is a set of projects that provide short cuts for common
Of course we all like clean disgin, but I like "clean design" unless it
doesn't make me to write 20 lines of code to simply zip or jar the folder
(same goes for file reading).
IO Commons provides means to read file into byte array, why not to add a
method to read a file or dir as compressed byte array too?

Vitaliy S

On 6/18/06, Torsten Curdt <> wrote:
> > Sorry, what is compress?
> > I don't know a class or project in apache commons with such name.
> Chris is working of an overhaul of the API and implementations though.
> > I think these methods could be added to IOUtils or FileUtils.
> IMO compression is beyond the scope of IO.
> cheers
> --
> Torsten
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Vitaliy S

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message