Call/WhatsApp: +1 914 416 5343

Reading and Writing Files in a Directory

Create a program that provides a listing of all the files in a directory. The program should be a Java application that accepts a single argument into the args array of the main() method. This argument identifies the name of a directory. The application should make sure that this filename really does identify a directory and then list all of the files in the directory. For each file, list whether the file is a file or a directory and list the size for each file. The program should print its output to System.out.