Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need the solution in java please :) In this project, you are required to write a network application that implements a TCP client/server file

I need the solution in java please :) image text in transcribed
In this project, you are required to write a network application that implements a TCP client/server file transfer framework. Your framework should consist of a server application and a client application according to the following specifications: The client application should : Ask the user whether he wants to upload or download a file or exit. If the user chooses to upload a file, it should first inform the server that the operation requested is to upload a file. Then, it should prompt the user to enter the name of the file he wants to upload. You may assume that all files that will be uploaded reside in the parent directory of the client project. If the file does not exist, it should notify the user that the file does not exist and re- prompt him to enter a file name. Then, it should send the file name to the server, read the file contents and send them to the server. The program should keep on prompting the user until he enters an existing file on the client side. If the user chooses to download a file, it should first inform the server that the operation requested is to download a file. Then, it should prompt the user to enter the name of the file he wants to download. If the server responds that the file exists, it should start reading the received file contents, open a file on the client side and write the received contents to it. If the server responds that the file does not exist, it should re-prompt the user to enter a valid file name and re-perform the download operation. The program should keep on prompting the user until he enters an existing file on the server. If the user chooses to exit, it should terminate the connection with the server The server application should : Listen to clients' requests to connect. The server application should be multi-threaded such that it serves each client's request in a separate thread. If the server receives that the user wants to upload a file, it should first receive the file name, create a file with the same name, then read the contents and write them to the created file. If the server receives that the user wants to download a file, it should first receive the file name and inform the client whether it exists or not. If the file does not exist it should read the file name again from the user, until a valid existing file name is received. If the file exists it should return to the client that it exists and start writing the file contents to the client. You may assume that all files that will be uploaded reside in the parent directory of the server project Note: Create a separate project for each of your client program and server program so that you can test files transfer between the two sides

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Accounting questions