I am trying to create a program that returns the name of all video files and folders in a file. I already found the pattern for the video files and it works fine
String pattern = "(^\\w[ .A-z0-9_-]+(\\.mp4$|\\.avi$|\\.mkv$))";
But i'm stuck on how to read the folders. Everything I've tried has the pattern reading folders, but also other files as well. Since the folder name may have dots anywhere, its hard to isolate by extensions. Any ideas on how to read only folders?
File.isDirectory()method.