How can I access the CD Rom drive (in my case, F:) from Java? I don't mind platform specific code. I am using Windows 8. I have the following code but get AccessDenied.

```
    public static void main(String args[]) throws IOException {     
        File cd = new File( "f:\\lang" );
        System.out.println(cd.canRead());
        RandomAccessFile rawAccess = new RandomAccessFile( cd, "r" );

        rawAccess.close();
   }

```

The 3 trues are checking for cd.canRead, cd.canWrite, cd.canExecute.

```
   true
   true
   true
   Exception in thread "main" java.io.FileNotFoundException: f:\lang (Access is denied) at java.io.RandomAccessFile.open(Native Method)
   at java.io.RandomAccessFile.<init>(Unknown Source) at myapp.main(myapp.java:16)

```