We have a linux app where we are not able to unmount a USB drive because of the below call. Is there a file resource I need to properly close the stream?
Files.newDirectoryStream(
Paths.get(importDir),
path -> path.toString().endsWith(".ini") && path.toFile().isFile())
.forEach(path -> importItems.add(path));
here is the output from the response:
umount: /media/flashdrive: target is busy
(In some cases useful info about processes that
use the device is found by lsof(8) or fuser(1).)
we are currently using java 8.