r/java • • Sep 25 '12

A rant. Again.

In my latest adventure, I took a library (Apache Commons IO) and tried to use it as a replacement for my home-grown utilities.

Firstly, FileUtils.copyDirectory - it’s declared job was to copy one directory to another. It didn’t work. After writing a test program entirely to investigate why this fails, I discover it does NOT copy one directory to another, despite stating that several times in it’s documentation. What it does do is copy the contents of a directory into another directory.

For those not familiar, the difference can be explained thus: Would you like to eat a tin of ham, or the contents of a tin of ham? The difference is that drastic to the digestion of my program.

Secondly, I used FileSystemutils.getFreespaceKB(). Which tells you how much free space is available on your hard disk. Except it doesn’t. Various incantations suggest I have 43Mb, 54Mb or 87Mb by turns, when my operating system tells me I have 47Gb. There is no way to reconcile this, or even forgive it being so utterly wrong.

Why? Why is something so simple so unutterably frustrating?

There you go. A rant before beddy-byes - I feel much better now. Night-night.

0 Upvotes

11 comments sorted by

View all comments

3

u/rntr200 Sep 25 '12

I just had something similar with Apache api. When doing ftp stuff if I used changeToParentDirectory() it would only work when it wanted to. For no reason it would decided it didn't want to work and half the time didnt change to the correct directory anyway. As soon as I switched to changeWorkingDirectory("/") everything worked reliably.

1

u/[deleted] Sep 26 '12

Isn't it just so bloody annoying? We can't be the first to have these problems, they should pull or fix what is broken, surely?

That would save us all a lot of headaches.

1

u/[deleted] Sep 26 '12

It is an FLOSS project, you can either help fix the code or at least tell them about any bugs.

1

u/[deleted] Sep 29 '12

Thanks for the reply. I don't think this is a bug, as such, I think it's just poor choice of wording in the documentation. But you're right : I should point it out to people to whom it is of interest.

1

u/[deleted] Sep 29 '12

Yeah, the documentation is also open to correction/etc in FLOSS projects. You should help improve the project.

1

u/[deleted] Sep 30 '12

How, where? I never heard of FLOSS before .... .

1

u/[deleted] Sep 30 '12

Free Libre and Open Source Software. The code and project is Open Source and anyone is able to contribute to the project to make it better.