Hello, in this video we are going to look at navigation or more specifically listing directories, and you know files and all that sort of stuff. So what we're going to do is specify a path. And it'll be on our computer specify where we want to list out what's inside of it is nothing more to it than that. But first of all, you want to create an import file. And we're going to do file and call it F equal No, or initialize it in this string, and this is going to be an array. So this is simply going to be all of the, you know, the folders inside of that array, the files in that array.
I mean nine that right in the actual folder directory that we specify. So it's going to be everything inside of there. We just boil into a new file. You're here to put this you know, this code onwards in a try catch block, you check out the exceptions sections series and come back and modify those keeping it simple, do backslash backslash upstart goes to the root. And so if I go here, so this is my root directory, and in here we've got occasion. So you will list out all of this if we do.
Now you want to do path equals foil, F dot list, like so. And now we're gonna simply use a for each loop, print over, loop over and print all the paths. So strength pain path, and what we're going to do is in here Okay, run it There we go. We've got everything that's in this application directory. That's it. There's nothing more to it than that.
If you have any questions feel free to reach out and all the ports in Union next awesome Java video.