This discussion is archived
2 Replies Latest reply: Aug 2, 2012 1:15 AM by Jörg RSS

FileSystemView, Localized TypeDescription

Jörg Explorer
Currently Being Moderated
Hello,

the following code lists a computer's drives
import java.io.*;
import javax.swing.filechooser.*;

public class Drives {
  public static void main(String[] args) {
    File[] files = File.listRoots();
    FileSystemView fsv = FileSystemView.getFileSystemView();
    for (int i = 0; i < files.length; i++)
      System.out.println(fsv.getSystemTypeDescription(files)+" "+files[i]);
}
}
The drive types are returned in the language of the OS.
So the simple question/request is:
Would someone running an English or French OS be so kind and run the programme and note down the different drive types for me.

The more difficult question: How does java retrieve these localized drive names, respectively where can they be found?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points