How do I check if a directory exists in Java?

Posted on

Question :

I’m trying to check if a directory entered in a JTextField exists or not. I tried to use Files.notExists() but the first argument must be of type Path and I could not figure out how to convert from String .

String caminho = txtDirIndexado.getText().replace("", ""\"")

Answer :

Leave a Reply

Your email address will not be published. Required fields are marked *