Example usage for javax.swing.filechooser FileSystemView isFloppyDrive

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

Introduction

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

Prototype

public boolean isFloppyDrive(File dir) 

Source Link

Document

Used by UI classes to decide whether to display a special icon for a floppy disk.

Usage

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

public static boolean isStoredOnFloppyDrive(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.isFloppyDrive(f);
        }/*w  w w.  ja  v  a  2  s. c om*/
    }
    return false;
}