if(Kernel32.isAvailable()) {
/** * Attemps to detect if this file is the root of a removable media drive (floppy, CD, DVD, USB drive...). * This method produces accurate results only under Windows. * * @return <code>true</code> if this file is the root of a removable media drive (floppy, CD, DVD, USB drive...). */ public boolean guessRemovableDrive() { if(IS_WINDOWS && Kernel32.isAvailable()) { int driveType = Kernel32.getInstance().GetDriveType(getAbsolutePath(true)); if(driveType!=Kernel32API.DRIVE_UNKNOWN) return driveType==Kernel32API.DRIVE_REMOVABLE || driveType==Kernel32API.DRIVE_CDROM; } // For other OS that have root drives (OS/2), a weak way to characterize removable drives is by checking if the // corresponding root folder is read-only. return hasRootDrives() && isRoot() && !file.canWrite(); }
if(Kernel32.isAvailable()) {
else if(Kernel32.isAvailable()) {
else if(Kernel32.isAvailable()) {
if (!Kernel32.isAvailable()) return false;