Java I/O How to - Java Directory Example

  1. Java Check if a directory is not empty
  2. Java Delete folder
  3. Java Display directory tree
  4. Java Get all files and folders under a certain folder and save them to a set
  5. Java Get a File array containing the children files and directories
  6. Java Get a string array containing the children files and directories
  7. Java Get DirectoryStream from a Path with file name matcher
  8. Java Get Home/Default Directory
  9. Java Get Java Home directory
  10. Java Get name of parent directory
  11. Java Get operating system temporary directory / folder
  12. Java Get the content of a directory via
  13. Java Get the Current Working Directory
  14. Java Get the name of the parent directory of the file or directory represented
  15. Java List the Directory Contents recursively
  16. Java Recursively list all files within a directory and sub directories
  17. Java Rename a file or directory
  18. Java Use java.nio.file.DirectoryStream to process the contents of a directory


  1. Java Copy a Directory


  1. Java Create a directory
  2. Java Create a directory filter
  3. Java Create a directory including any parent directories
  4. Java Create Directories with java.nio.file.Files
  5. Java Create parent directories if not present


  1. Java Traverse all files and directories under dir
  2. Java Traverse only directories under dir