tags:

views:

104

answers:

3

Hi,

Is there an API that can provide me more in depth information on a file/directory on the disk? For e.g. I would want to know if a drive is a root drive or a floppy drive , a file is a hidden file etc..?

Thanks Shafi

+3  A: 

The java file API is sort of the minimum common denominator between the various platforms, e.g. not all platforms have the concept of drives.

You can get all the root drives with File.listRoots() , and you can check if it's hidden with File.isHidden()

nos
+1  A: 

Not a direct answer to your question but check out the apache commons lib.

http://commons.apache.org/io/

It may be of some help.

Karl

Karl
A: 

Swing includes the FileSystemView class, which exposes information about drives, special folders and other os-specific filesystem info.

You can get an instance calling a static factory method:

FileSystemView.getFileSystemView();
Massimiliano Fliri