FileSystemView

1097138676000

Since the java class library that accompanies the JVM includes thousands of classes (and the number is growing all the time) it's nearly impossible to have ever used all these classes. I would be suprised if a developer who claims to have used every single class is ever found.

Occaisionally when reffering to the apidoc, a class that has always been there but you never noticed suddenly catches your eye. That's what happened to me with javax.swing.filechooser.FileSystemView just now. Suddenly I was filled with the overwhelming temptation to write a few lines of code to figure out a practical use for this class.

I knew that this class is being used by the FileChooser to create those icons but nothing more than that, I wanted to find out if the FileSystemView would be able to produce the same icon as konqueror or nautilus produces.

Sadly it falls short. For me FileSystemView produced only two icons, one that symbolized a folder and another that symbolized a file. Fat use that is, I can easily do the same with just two three lines of code that includes a call to the File.isDirectory() method.

There are some files in my home folder with wierd characters, some of them I occaisionaly use as bait on mega Upload, FileSystemView choked on them.

comments powered by Disqus