Pergunta

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?

Foi útil?

Solução

Try this:

File.listRoots();

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top