When I insert a DVD or CD, I want to programmatically know what type of media(DVD or CD) is it.
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.
IMHO impossible to get this solved with pure Java. The only thing you can do is via the FileSystemView and detect whether a certain file is a cd/dvd drive but not if it contains a CD or DVD as media. Although a one can perform an educated guess by getting the total used space.
For a working solution you’ll need at least JNI code for the three ‘big’ OS. I’m not aware of any project that has done this. There are only platform specific libraries / utilities for Linux that use the usual cdrw/dvdrw tools in the background.