Question: 1. Create a file using any word-processing program or text editor. Write an application that displays the files name, containing folder, size, and time of

1. Create a file using any word-processing program or text editor. Write an application that displays the files name, containing folder, size, and time of last modification. Save the file as FileStatistics.java.

Below is a shell I have

1 import java.nio.file.*; 2 import java.nio.file.attribute.*; 3 import java.io.IOException; 4 public class FileStatistics 5 { 6 public static void main(String[] args) 7 { 8 Path file = 9 Paths.get("C:\\Java\\Chapter.13\\TestData.txt"); 10 try 11 { 12 // declare count and then display path, file name and folder name 13 14 15 16 // declare a BasicFileAttributes object, then add statements to display the file's size and creation time 17 18 } 19 20 catch(IOException e) 21 { 22 // add display IOException 23 24 } 25 }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!