Example usage for javax.swing.filechooser FileSystemView getSystemTypeDescription

List of usage examples for javax.swing.filechooser FileSystemView getSystemTypeDescription

Introduction

In this page you can find the example usage for javax.swing.filechooser FileSystemView getSystemTypeDescription.

Prototype

public String getSystemTypeDescription(File f) 

Source Link

Document

Type description for a file, directory, or folder as it would be displayed in a system file browser.

Usage

From source file:org.dbgl.util.FileUtils.java

public static boolean isStoredOnCDRomDrive(File file) {
    if (PlatformUtils.IS_OSX)
        return false; // FileSystemView doesn't work on OSX and leads to freeze on application exit

    FileSystemView fsv = FileSystemView.getFileSystemView();
    for (File f : File.listRoots()) {
        if (areRelated(f, file)) {
            return fsv.isDrive(f) && fsv.getSystemTypeDescription(f).toUpperCase().contains("CD");
        }// w w w . ja va 2s .  c om
    }
    return false;
}