Sie sind auf Seite 1von 12

CT024-3.

5-3 Distributed Computing

Assignment

Contents
Acknowledgement .......................................................................................................................... 2
Introduction ..................................................................................................................................... 3
Internet Protocol Suite .................................................................................................................... 3
Internet Protocol.............................................................................................................................. 3
Transmission Control Protocol ....................................................................................................... 4
The FTP File Transfer Program ...................................................................................................... 5
Features involved in the program ................................................................................................... 8
Upload File.................................................................................................................................. 8
Browsing for file ......................................................................................................................... 9
Connect to IP Address .............................................................................................................. 10
Conclusion .................................................................................................................................... 12

Bsc(Hons) In Software Engineering

Page 1

CT024-3.5-3 Distributed Computing

Assignment

Acknowledgement
I would like to thank Mr. Muhammad Ibrahim Ravi, who is my lecturer for Distributed
Computing module, to give me the opportunity to complete this assignment, in which I have
learnt many new methods and experiences while developing the file transfer program. This
allows me to further my experience in developing programs which uses Remote Method
Invocation (RMI) and Transmission Control Protocol (TCP).

Bsc(Hons) In Software Engineering

Page 2

CT024-3.5-3 Distributed Computing

Assignment

Introduction
The assignment is to create a File Transfer program which uses an FTP server and client. This
program also uses RMI and TCP sockets in uploading and downloading the files from server to
client. In the file transfer program, the user is able to search for a file and upload the file, or
download the file from the server.

Internet Protocol Suite


- is a set of communications protocols used by the Internet and other networks that are similar to
the Internet.
- is also commonly known as TCP/IP which is named from 2 of the most important protocols in
it which is the Transmission Control Protocol (TCP) and Internet Protocol (IP) which are also
the first 2 protocols defined under this standard.

Internet Protocol
-

Is the principle communications protocol used for relaying datagrams which are also
known as packets across an internetwork using the Internet Protocol Suite.

It is also in charge of routing the packets across network boundaries which makes it the
primary protocol that establishes the Internet.

Is the primary protocol in the Internet layer of the Internet protocol suite

Delivers datagrams from the source host to the destination host based only on their
addresses.

Addresses methods and structures for data encapsulation.

Bsc(Hons) In Software Engineering

Page 3

CT024-3.5-3 Distributed Computing

Assignment

Transmission Control Protocol


-

Is one of the core protocols in the Internet Protocol Suite


Is one of the 2 original components of the suite
Provides ordered delivery of a stream of bytes which are reliable from a program on one
computer to another program on another computer
Is the protocol that major Internet applications rely on.

Bsc(Hons) In Software Engineering

Page 4

CT024-3.5-3 Distributed Computing

Assignment

The FTP File Transfer Program


The FTP File Transfer Program has 3 frames, with 3 functions, which are:
-

Connect function

Upload function

Download function

with a total of 3 frames, which are:


-

Main Frame

Upload File Frame

Download File Frame

Main Frame

The main frame is the start frame of the program, in which when the program is started, the
program will load the main page first. The main page also allows the user to select whether the
user wants to upload the file or download the file.
Bsc(Hons) In Software Engineering

Page 5

CT024-3.5-3 Distributed Computing

Assignment

Upload File Frame

The upload file frame is a section of the program in which the user is able to connect their IP
address and port number, and upload items to the server. The upload section allows the user to
search for a specific file, and upload the file to the server. The file search only searches for
specific files which are either JPG, JPEG, GIF, TXT and PNG only, in which these files are only
allowed to be uploaded into the server.

Bsc(Hons) In Software Engineering

Page 6

CT024-3.5-3 Distributed Computing

Assignment

Download File Frame

The download file frame is a section in the program in which the user is able to connect their IP
address and the port number to the server to view and download files into the server. The
download section lists files down in a table, and allows the users to select and download the
specific file.

Bsc(Hons) In Software Engineering

Page 7

CT024-3.5-3 Distributed Computing

Assignment

Features involved in the program


Upload File

Based on the code above, the upload file button calls the send file function, in which the send file
function gets the file path from the textbox, and using the File import function, stores the file
path with the File. When the file is uploaded, the program will display a message that the file has
been uploaded. If the file is repeated, or has the same file name, a message dialog box will
appear stating that the file has already been uploaded before in the system. If the file path does
not exist, the program will display a message dialog box stating that the file does not exist.

Bsc(Hons) In Software Engineering

Page 8

CT024-3.5-3 Distributed Computing

Assignment

Browsing for file

Based on the above code snippet, the browse file button allows a open dialog to display the files
so that the user is able to select the file to be uploaded into the server. The file selected will then
be listed into the file name textbox, while the file path will be listed in the file path textbox.

Bsc(Hons) In Software Engineering

Page 9

CT024-3.5-3 Distributed Computing

Assignment

Connect to IP Address

Based on the code above, the connect function connects the socket with the IP address and the
port number, in which the object output stream and the object input stream is linked with the
socket. When the server is connected, the program will display a message which states it is
connected to the server.

Bsc(Hons) In Software Engineering

Page 10

CT024-3.5-3 Distributed Computing

Assignment

Download File

Based on the code above, the download file button invokes the receiveFile method in which the
receiveFile method gets the selected row of the table, and gets the index of the table based on the
file name which is selected, and then downloaded the file into the path which is defined in File f.
After the file has been downloaded, the system prints out a message that the file has been
downloaded, and close the buffer output stream.

Bsc(Hons) In Software Engineering

Page 11

CT024-3.5-3 Distributed Computing

Assignment

Conclusion
During the progression of this assignment, I as the developer had learnt many new java
programming codes related to Remote Method Invocation (RMI) and Transmission Control
Protocol (TCP). Besides that, I also have learnt on how many different methods to upload files
and download files, as well as connect the client side to the server side.

Bsc(Hons) In Software Engineering

Page 12

Das könnte Ihnen auch gefallen