Mohamed Sanaulla wrote:Java 7 has few APIs to get this information.
Each file location/directory location can be represented using instance of Path class and to obtain an instance of Path you need to make use of the Paths.get(location) API.
Each Path instance has a number of components to it: File Name, Parent and Root. In your case you would be looking for a Root element which can be obtained using pathInstance.getRoot()
Couldn't quite see how you would get from a Path to a drive label.
This is an Fsv class that wraps around the FileSystemView class. Its main method just prints out all of the root file systems. The output I get looks something like this: (Only better. The post really screwed up the columns.)