Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.util.Arrays;
- import java.util.List;
- import javax.swing.filechooser.FileSystemView;
- public class Test2 {
- public static void main(String args[]){
- List <File>files = Arrays.asList(File.listRoots());
- for (File f : files) {
- String s1 = FileSystemView.getFileSystemView().getSystemDisplayName (f);
- String s2 = FileSystemView.getFileSystemView().getSystemTypeDescription(f);
- System.out.println("getSystemDisplayName : " + s1);
- System.out.println("getSystemTypeDescription : " + s2);
- }
- /* output (French WinXP)
- getSystemDisplayName :
- getSystemTypeDescription : Disquette 3½ pouces
- getSystemDisplayName : REGA1 (C:)
- getSystemTypeDescription : Disque local
- getSystemDisplayName :
- getSystemTypeDescription : Lecteur CD
- getSystemDisplayName : My Book (F:)
- getSystemTypeDescription : Disque local
- */
- }
- }
Add Comment
Please, Sign In to add comment