Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically Unmounting drive from Java

Does anyone knows how to unmount a drive in java in OSx

I am trying to unmount a sdcard from java. I am using java Swing class and the drive gets mounted automatically, but how do I unmount it.

like image 879
Arindam Bhattacharjee Avatar asked Jan 23 '26 12:01

Arindam Bhattacharjee


1 Answers

The concept of mounting/unmounting is not platform agnostic, so it doesn't exist directly within the Java APIs. You will most probably have to issue a command line call to unmount by using Runtime.exec()

There might be open source libraries available that wrap this exec call for you, but I'm not positive.

like image 132
rfeak Avatar answered Jan 26 '26 01:01

rfeak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!