Page 1 of 1

Write Java program for this assignment, Don't copy from another answers questions. Thanks beforehand!

Posted: Fri Apr 29, 2022 7:03 am
by answerhappygod
Write Java program for this assignment, Don't copy from another
answers questions. Thanks beforehand!
Write Java Program For This Assignment Don T Copy From Another Chegg Questions Thanks Beforehand 1
Write Java Program For This Assignment Don T Copy From Another Chegg Questions Thanks Beforehand 1 (194 KiB) Viewed 28 times
Part1 (basic: 60%) We have already seen how to copy a file using java. Utilizing that knowledge write a program that given a list of files (names) and the destination (all through command line input as executing the program), it will copy all those files into the destination folder. Note: if a specified path is a directory, mention that it is a directory, and skip copying it. Note: handle all the possible exceptional cases and user error. Note: every time a file is copied, print the number of bytes copied. Example: if file size is 36 bytes, print 36 B. if file size is 3635 bytes, print 4 KB. if file size is 3635124 bytes, print 4 MB. Given a list of directories and files followed by the destination copy all these directories (recursively) and files into the destination. Note: all the subdirectories and files inside the given directories must be kept in the same nested structure in destination folder. Assume that the folder structure is as following: (use tree /F command to see the directory structure recursively, just tree on Mac or Linux) -dest -resources docs -books some citations.txt american Ls -London BEFORE ADAM.txt THE IRON HEEL.txt The People of the Abyss.txt -russian HDostoevsky The Gambler.txt THE POSSESSED (The Devils).txt -Tolstoy MASTER AND MAN.txt -personal doc1.txt doc2.txt Sened.docx -ime adal.jpg ada2.jpg download (1).jpg download.jpg Executing java YourAppName "resources/docs/books" "resources/docs/books/some citations.txt" dest Output: [Note that every nested folder and its contents are printed with one more indentation >Started: resources\docs\books... >Started: resources docs\books american.. >Started: resources\docs\books american London... >Started: resources docs\books american London BEFORE ADAM.txt.. >Finished FILE: resources\docs\books american London BEFORE ADAM.txt >Total 229KB were copied! >Started: resources\docs\books american London\THE IRON HEEL.txt... >Finished FILE: resources\docs\books american London THE IRON HEEL.txt >Total 528KB were copied! >Started: resources docs books american London The People of the Abyss.txt... >Finished FILE: resources\docsbooks american London The People of the Abyss.txt >Total 370KB were copied! >Finished FOLDER: resources docs books american London >Finished FOLDER: resources docs\bookslamerican >Started: resources docs\books russian. >Started: resources docs books russian\Dostoevsky. >Started: resources\docs\books russian Dostoevsky The Gambler.txt.. >Finished FILE: resources\docs\books russian\Dostoevsky The Gambler.txt >Total 357KB were copied! >Started: resources\docs\books russian\Dostoevsky THE POSSESSED (The Devils).txt... >Finished FILE: resources docs books russian\DostoevskyTHE POSSESSED (The Devils).txt >Total 2MB were copied! >Finished FOLDER: resources\docs\books russian Dostoevsky >Started: resources\docs\books russian Tolstoy. >Started: resources docs\books russian Tolstoy\MASTER AND MAN.txt... >Finished FILE: resources\docs\books russian Tolstoy\MASTER AND MAN.txt >Total 127KB were copied! >Finished FOLDER: resources\docs\books russian Tolstoy >Finished FOLDER: resources docs\books russian >Started: resources\docs\books some citations.txt... >Finished FILE: resources docs books some citations.txt >Total 435B were copied! >Finished FOLDER: resources\docs\books >Started: resources\docs\books some citations.txt... >Finished FILE: resources\docs\books some citations.txt >Total 435B were copied! dest some citations.txt -books some citations.txt american -London BEFORE ADAM.txt THE IRON HEEL.txt The People of the Abyss.txt russian -Dostoevsky The Gambler.txt THE POSSESSED (The Devils).txt Tolstoy MASTER AND MAN.txt Produces a (dest) folder structure: