Find the directory for a FileStore

前端 未结 4 1258
清歌不尽
清歌不尽 2020-12-16 00:21

I\'m trying to find a way to detect when a flash drive has been plugged into my computer. So far, the solution I found was to poll FileSystem#getFileStores for changes. This

4条回答
  •  轮回少年
    2020-12-16 00:55

    I've not really explored this area of java, but I found this, which seems to be related. It uses File.listRoots()

    There also seems to be a number of related questions linked there too.

提交回复
热议问题