import java.io.*;
      
      File f = new File(filePathString);
      if(f.exists() && !f.isDirectory()) { 
          // do something
      }
      
      Java language logo

      Test if a directory exists

      file
      directory
      Java Public Recipes

      Check if a directory exists in Java

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.