Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Network & Security Expert

Client

Once the GUI application is loaded, it will send a request (instance/object of Commands class) to server for a list of files from the server's shared directory.Client will write Commands object to ObjectOutputstream. Commands class has to implement Serializable interface as this will be transferred over the network. Commands class will have following value:
- nextCommand value in Commands object will be set to COMMAND_SEND_FILE_LIST
Server

Upon receiving the file list request, the server will read all the files (no directory) in the server's shared directory and wrap each file name and corresponding size in FileInfo object. DirInfo object will have a variable named fileList with type of List(implementation ArrayList). Server will write DirInfo object to socket's ObjectOuputStream so that client can read it from ObjectInputStream.DirInfo and FileInfoclass have to implement Serializable interface as these will be transferred over the network.

Client

Client will read DirInfo object from ObjectInputStream and populate the JList on "Remote File List" panelwith file names. At the same time, each fileName and corresponding fileSize should be saved in a HashMap.Once the JList is loaded and the user double clicks a file name in the JList, client will send a Commands object to server (by writing to ObjectOutputstream) with following values:
- nextCommand value in Commands object will be set to COMMAND_SEND_FILE
- fileName should be set with the double-clicked file name from the JList


Server

Upon receiving send file request (will read Commands object from ObjectInputStream), the server will read the nextCoomand and fileName from Commands object and start transferring the file bytes to client by writing to OutputStream (Could be wrapped into a BufferedOutputStream for efficiency).

Client

Client will read file binaries from InputStream(not ObjectInputStream) and finish reading when number of bytes read is length of the corresponding file name. The file length can be derived by passing the fileName to HashMap where file length was stored earlier while populating the JList based on DirInfo object received from server. Once the file content is read it will be then saved in the download directory on client machine.

Computer Network & Security, Computer Science

  • Category:- Computer Network & Security
  • Reference No.:- M9543801

Have any Question?


Related Questions in Computer Network & Security

Question 1 for rsa encryption we need a modulus that is the

Question : 1. For RSA encryption we need a modulus that is the product of two prime numbers, p and q. Assume p = 11 and q = 13, and thus n = p*q = 143. In this case, the RSA encryption exponent e must be relatively prime ...

Advanced network design assessment - human factors in

Advanced Network Design Assessment - Human factors in network analysis and design Purpose of the assessment - This assignment is designed to assess students' knowledge and skills related to the following learning outcome ...

Question 12326 packet tracer - configuring pap and chap

Question 1 2.3.2.6 Packet Tracer - Configuring PAP and CHAP Authentication Submit your answer as Q1.pka Question 2 2.5.1.2 Packet Tracer - Skills Integration Challenge Submit your answer as Q2.pka Question 3 3.4.2.4 Pack ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Wireless sensor networks wsn let users to access servers

Wireless Sensor Networks (WSN) let users to access servers, printers, and other network resources regardless of their location, within the wireless reach. This flexibility means that, for example, a user's laptop stays c ...

Data communications and networks assignment -aim a library

Data Communications and Networks Assignment - Aim: A library research and industry related project is to be carried out on a topic of your choice. The project topic must be related to Data Communications and Networking. ...

Content analysis assignmentoverviewthis assignment has

Content Analysis Assignment Overview This assignment has three major aims: - To help students gain good understanding of all ITECH1102 theoretical and practical material. - To encourage students to use content analysis s ...

True or false1 tcp ensures error free transmission2 the

TRUE or FALSE 1. TCP ensures error free transmission. 2. The process that initiates the communication is the server. 3. A host can serve as both server and client in a P2P network. 4. Audio and video applications cannot ...

Security challenges in emerging networksassignment

Security Challenges in Emerging Networks Assignment Description The purpose of this assignment is to develop skills to independently think of innovation. In this assignment students will first learn how to develop knowle ...

Assessment taskstarting from the logical network design

Assessment Task Starting from the logical network design that you completed in Assessment Item 1, you are required to undertake the physical design of the network taking into consideration the feedback that you received ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As