문제

I'm writing a disk crawler and if the user doesn't provide an existing path the program should search all disks that are available. Does anybody know is it possible and if it is how to do that from Java?

도움이 되었습니까?

해결책

Try this:

File.listRoots();

다른 팁

Only works on windows, on unix based operating system you will have 1 root, independent of the number of disks.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top