How to differentiate CD-Drive and Hard Disk-Drive in Java?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is a solution I found using VBScript. Native Java does not distinguish between CD-Drive and Normal drives, it just files and dirs.
But this solution will only work on Windows.
Another solution for Windows is JNA
So, for Linux based machines, you can call a linux command from your Java code. Call a bash script.