Nobody has understood the question thus far.
Please read. It's Java.
Write a client program and server program. The server uses a socket connection to allow a client to supply a filename and the server will send the file contents to the client or an error message if the file does not exist. The client will create a new file with the same contents. The client will supply the filename "input.txt" to the server and create as it's output "output.txt". Don't ask the user for these names. The Server sends whatever file the Client requests. Don't put "input.txt" in the Server. The client must get the contents from the Server. It must not read input.txt directly.
Do not accept arguments from the command line.
One class named Server and one named Client. These must be the ONLY 2 CLASSES
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
I keep getting the same, incorrect answer.. I got it on my own by now, I wanted to see if anybody on here could do it as well. It shouldn't ask for a filename, the client should supply the filename input.txt (which I have in the IDE) and then the server sends the file for the client to output the same content but in another file called output.txt.
Challenging, but possible.
I might keep the subscription if someone is able to figure it out.
I keep getting the same, incorrect answer.. I got it on my own by now, I wanted to see if anybody on here could do it as well. It shouldn't ask for a filename, the client should supply the filename input.txt (which I have in the IDE) and then the server sends the file for the client to output the same content but in another file called output.txt.
Challenging, but possible.
I might keep the subscription if someone is able to figure it out.
- Using Python: Write a script which appends a line counter to an input file. This script creates a program listing from a source program. This script should prompt the user for the names of two files. The script copies the lines of text from the input file to the output file, numbering each line as it goes. The line numbers should be right-justified in 4 columns here in the input and ouputarrow_forwardWrite a java program that Reads text from the user provided file using FileReader Writes output to a file using the FileWriter class Catches IOException using try and catch block and prints a customized error message.arrow_forwardin java Integer cradleQuantity and string friendName are read from input. A FileOutputStream named fileStream is declared and the file named cradle.txt is opened. Then, a PrintWriter named cradleWriter is declared and associated with the file. Write the following to the opened file: "Remember:" "* * * *" cradleQuantity, followed by " cradles for " and friendName Another "* * * *" End each output with a newline. Finally, close the file. Ex: If the input is 12 Dax, then cradle.txt contains: Remember: * * * * 12 cradles for Dax * * * * Note: Data written to a file may be lost if the file is not closed. 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 public class FileOutput { publicstaticvoidmain(String[] args) throwsIOException { Scannerscnr=newScanner(System.in); FileOutputStreamfileStream=null; PrintWritercradleWriter=null; intcradleQuantity; StringfriendName; cradleQuantity=scnr.nextInt(); friendName=scnr.next();…arrow_forward
- Write a Java program that opens a file and counts the whitespace-separated words in that file. You may obtain the name of the input file either from the command line or via prompt and user input. Be sure to clearly document the method chosen. You may test your program using any number of text files; however, you must be sure to test your program using the Sample Text File provided at the end (excerpt.txt). Sample Text File There was nothing so VERY remarkable in that; nor did Alice think it so VERY much out of the way to hear the Rabbit say to itself, `Oh dear! Oh dear! I shall be late!' (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually TOOK A WATCH OUT OF ITS WAISTCOAT- POCKET, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before seen a rabbit with either a waistcoat-pocket, or a watch to…arrow_forwardCreate a simple java program that reads all the content in a .txt file, the user will enter the filename to be opened and once opened with any stream of choice, all the content in the file is printed to the screen. You are additionally expected to deal most common exceptions(See samples below) [HINT: DO NOT PROVIDE A PATH BUT RATHER ONLY OPEN THE FILE WITH RELATIVE PATH/FILENAME] Sample run 1: Enter filename: input.txt sample output 1: Hello files, I got the content NB: input.txt contains "Hello files, I got the content" as the data [See sample file]arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education