Bonjour,

Je vous propose un nouvel élément à utiliser : JNI : Récuperer le types des disques (Delphi)

Cet exemple met en évidence l'utilisation de JNI (Java Native Interface) en combinaison avec du code Delphi.

Exemple d'utilisation :



String drive = "c:\\";



int type = DriveInfo.getDriveType(drive);

switch(type){

case DriveInfo.FIXED :

System.out.println("c:\\ est un disque dur");

break;

default:break;

}



boolean amovible = DriveInfo.isRemovable(drive);

System.out.println("c:\\ amovible : "+amovible);



File[] roots = File.listRoots();

for(int i = 0; i < roots.length; i++){

File root = roots[i];

String name = root.getPath();

System.out.println(name+" : "+DriveInfo.getDriveInfo(name));

}



Qu'en pensez-vous ?