Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ON
UNIVERSAL BROWSER
Project work submitted in partial fulfillment of the requirement for
the award of degree of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING
BY
CH.PRAVEEN KUMAR
Mr.K.C.KRISHNAIAH
Associate Professor
Dept. of Computer Science & Engineering
NARAYANA ENGINEERING
COLLEGE
(AFFILIATED TO JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY,HYDERABAD)
NELLORE
CERTIFICATE
ACKNOWLEDGEMENT
completion of any task would be incomplete without mentioning the people who
“ENCOURANGING GUIDANCE”.
to Dr.P.Gopal Reddy garu, Principal for his benevolent good suggestion that
along with the purposeful guidance and moral support extended to us throughout
ABSTRACT
The Browser we normally use such as “internet Explorer” and “Netscape” is
generally limited by the capability with the number of servers it can communicate.
It cannot be possible to communicate with FTP server using “Internet Explorer”
and “Netscape”. Also it also lacks the ability to store “Text Files” in server address
space. To overcome the above difficulties we are intended to develop a project
which can efficiently handled the above requirements, using JAVA technology.
Our project basically consists of 3 modules.
1) E-cabinet Module:
This module provides the facility to store text files in the server
address space in the intended user’s login. This module is implemented using
JAVA
2) HTTP Module:
3) FTP Module:
This Module makes it possible to communicate with the FTP server.
Once we connect to the FTP server we can perform the basic “UpLoading” and
“DownLoading” operations with FTP server.
1.INTRODUCTION
luxury of having ready gigabytes at his disposal. Of course, the onset of laptops
and palmtops surely do provide this facility but not all people can afford them.
2. SUBJECT REVIEW
Layout Managers:
Layout managers are provided to arrange GUI components on a
container for presentation purpose. The layout managers provide basic layout
capabilities that are easier to use than determining the exact position and size of
every GUI component. This enables the programmer to concentrate on the basic “look
and feel” and lets the layout managers process most of the layout details.
Flow Layout:
Flow Layout is the most basic layout manager. GUI components are
placed on a container from left to right in the order in which they are added to the
container. When the edge of the container is reached, components are continued on
the next line. Class Flow Layout allows GUI components to be left aligned, centered
and right aligned
Border Layout:
The BorderLayout layout manager arranges the components into five
regions: north, south, center, east, west. A max of 5 components can be added
directly to the BorderLayout – one for each region. The components placed in the
North and South regions extend horizontally to the sides of the container and are as
tall as the components placed in those regions. The East and West regions expand
vertically between the North and South regions and are as wide as the components
placed in those regions. The component placed in the Center region expands to take
all remaining space in the layout.
GridLayout
The GridLayout layout manager divides the container into a grid so that
components can be placed in rows and columns. Class GridLayout inherits directly
Panels:
Complex GUI requires that each component be placed in an exact
location. They often consist of multiple panels with each panel’s components arranged
in a specific layout. Panels are created with class Jpanel. Jpanel’s may have
components including other panels added to them.
Menu Item
Menu
.
Using JPopupMenus:
Many of today’s computer applications provide so-called context-sensitive
popup menus. In Swing, such menus are created with class JpopupMenu.These
menus provide options that are specific to the component for which the popup trigger
event was generated. The popup trigger event occurs when the user presses and
releases the right mouse button.
Popup Menu
Using JDesktopPane and JInternalFrame:
For any application the only way a user can view the
visibility of the application through its GraphicalUserInterface.Many applications
use a multiple document interface containing other windows to manage several
open documents that are being processed in parallel. For example the mail
option in Internet Explorer can be viewed as a multiple document interface.
JAVA Swing technology provides this MDI format through its two most
important classes.
JDesktopPane
JInternalFrame
These two classes provide the support for creating multiple document interfaces.
JInternalFrame frame = new JInternalFrame (“Child Frame”, true, true, true, true)
Similarly the third and fourth containers uses “Horizontal” layout’s as its layout
managers
USING JTree:
With the JTree class, you can display hierarchical data. A JTree
object doesn't actually contain your data; it simply provides a view of the data.
Like any non-trivial Swing component, the tree gets data by querying its data
model. Here's a picture of a tree:
As the preceding figure shows, JTree displays its data vertically.
Each row displayed by the tree contains exactly one item of data, which is called
a node. Every tree has a root node from which all nodes descend. By default, the
tree displays the root node, but you can decree otherwise. A node can either
have children or not. We refer to nodes that can have children — whether or not
they currently have children — as branch nodes. Nodes that can't have children
are leaf nodes.
This JTree has been used in our project to display the list
of URL’s that have visited in the form of an Hierarchical way.
process is said to “LISTEN” to a port until a client connects to it. For FTP default port
number is 21 where as for HTTP it is 80.The-networking classes mainly used in this
software design are InetAddress, URL, Socket, ServerSocket, SocketImpl.
InetAddress:
The InetAddress class is used to encapsulate both the numerical IP
address and the domain name for that address. We interact with this class by using
the name of IP host, which is better than the numerical address. This class hides the
number inside.
URL:
The URL provides a reasonably intelligible form to uniquely identify or
address information on the Internet. The URL specification is based on four
components. First one is protocol to use, second one is host name or IP address, third
one is port number, which is optional, and last one is actual file path. This class has
several constructors and each can throw a MalformedURLException.
Those are
URL (String urlspecifier)
URL (String protocol Name, String hostname, int port, String path)
URL (String protocol Name, String hostname, String path)
SERVER SOCKET:
This class is used to create servers that listen for either local or remote
client programs to connect to them on published ports. This section develops the
operational web server. When we create a server socket it will register itself with the
system having an interest in client connections. The constructors for this class reflect
the port number that we wish to accept connections on and, optionally, how long we
want the queue for said port to be.
READER:
Reader is an abstract class that defines java’s model of streaming
character input. All the methods in this class will throw an IOException on error
conditions. Read (char buffer [ ]) method is used in the reader class. This
method attempts to read up to buffer. Length characters into buffer and returns
the actual number of characters that were successfully read. -1 is returned when
end of file is encountered.
WRITER:
Writer is an abstract class that defines streaming character
output. All the methods in this class return a void value and throw an IOException
in case of errors. The methods used that belongs to this class are write (char
ch), write (char buffer [ ]). The first method writes a single character to the
invoking output stream. Second one writes a complete array of characters to the
invoking output stream.
FILE READER:
The FileReader class creates a Reader that we can use to read the
contents of a file.
The constructors are
FileReader (String filepath)
FileReader (File fileobj)
Either can throw a FileNotFoundException. Here file path is a full path
name of a file and fileobj is a File object that describes the file.
FILEWRITER:
FileWriter creates a Writer that we can use to write to a file.
The constructors are shown here.
FileWriter(String filepath)
FileWriter(String filepath,Boolean append)
FileWriter(File fileobj)
They can throw IOException. Here filepath is the full path name of a file.
Fileobj is a File object that describes the file. If append is true then output is
appended to the end of file.FileWriter will create the file before opening it for
output when you create the object. In case where you attempt to open a redonly
file an IOException will occur.
File:
The file class does not operate on streams it deals directly with
files and filesystem. It does not specify how it is retrieved from or store in files, it
describe the properties of the file itself. A file object is used to manipulate or
obtain int associated with a disk file and to navigate subdirectory hierarchies.
Files are a primary source id destination for data. There are central resources for
storing persistent and shared int.
The Constructors are shown here:
File (string directorypath)
File (string directorypath,string Filename)
File (dir obj, string Filename)
Methods in a file
Getname( ) returns the name of the file
GetParent( ) returns name of parent directory
Exists( ) returns true if file exists
All vectors start with an initial capacity. After this initial capacity
is reached, the next time that you attempt to store an object in the vector, the
vector automatically allocates space for that object plus extra room for add1
object. By allocation more than required no of vectors the no of allocations made
to be reduced. Vector defines these protected data members.
2.STRING TOKENIZER:
It provides the 1st step in the parsing process. Often called
lexical analysis or scanner. This class implements the enumeration interface.
Therefore, given a string, you can enumerate the individual tokens contained in it
using string tokenizer.
To use this we have to specify the input string that
contains delimiters. Delimiters are characters that separate tokens. For
example ( ; : ).sets delimiters to comma, semicolon, colon. The default set
of delimiters consists of the white space characters space, tab, new line
and carriage return.
Hardware specification
• Monitor: 14 inches
• Mouse: ZENITH
Software specification:
OPERATIONAL FEASIBILITY:
ECONOMICAL FEASIBILITY:
The development of the system needs minimum amount of
cost on part of the developer .The project is developed entirely using JAVA hence
there is no constraints of mixing various languages. Also there is no need of a
backend for our project, which makes it economically viable. The maintenance
cost is also less. The proposed system doesn’t need additional procurement of
software or hardware for its development, as they are readily available. Hence
the project is economically feasible.
3.4 System Analysis
Introduction :
a thread to take care of the execution of that client. Multithreading is achieved using
the versatile Thread class in conjugation with the Runnable interface.
The software uses the Vector data structure to
have an exchange of information over the network between the Server and each
instance or thread of a client. In essence, the Java Virtual Machine uses the TCP/IP
protocol when it uses the Socket and the Server Socket class, so the software
implicitly uses the TCP/IP protocol for its implementation.
buttons are provided to either open, rename or delete the file as per the user’s
requirement.
When the window of the applet is closed, the applet gets
destroyed. But before getting destroyed, the program closes all the open sockets
of the thread which produced the applet. When the server frame is closed, the
server socket gets closed and hence no more listens for incoming connections.
At this stage if there is a request from a client the message is displayed that
there is no Network Connection.
The data transferred may be a part of a file, an entire file or a number of files. The
path may be between a server-DTP and a user-DTP, or between two server-
DTPs. The passive data transfer process "listens" on the data port for a connection
from the active transfer process in order to open the data connection.
ANALYSIS
FTP is a protocol that manages files on a remote machine.
It has commands for copying files to and from remote machine and for renaming
and deleting files. You have to first make a connection to the remote server. Then
you will be able to download or upload files. You will feel as if you are directly
working on the other machines. There is no need to worry about the security.
Don’t think FTP will also allow others to connect to the same remote system and
download your files. It protects access by user name and password combinations
as is done on most of today’s systems. But it also has a form called
“ANONYMOUS FTP”. Here username “ANONYMOUS” is recognized as valid
without any password.
Assume that you have some technical stuff in your system
and you wish to provide that to others. Then in normal FTP you should have
given username and password to all those who wish to take your services. It is
also boring for both of you if others are going to take the information only once.
Others should ask you for a login id and password and you have to assign them.
They will throw away their id after use but your server still maintains them in the
user list.
In such occasions you will find “ANONYMOUS FTP”
useful. They will just login as ANONYMOUS and the system will not ask for any
password they can take the free stuff from your server. Here the users will have
only limited access.
The secured exchange of files in FTP consists of the
following steps.
server-FTP process
A process or set of processes which perform the function
of file transfer in cooperation with a user-FTP process and, possibly, another
server. The functions consist of a protocol interpreter (PI) and a data transfer
process (DTP).
server-PI
The server protocol interpreter "listens" on Port L for a
connection from a user-PI and establishes a control communication connection.
It receives standard FTP commands from the user-PI, sends replies, and
governs the server-DTP.
type
The data representation type used for data transfer and
storage. Type implies certain transformations between the time of data storage
and data transfer. The representation types defined in FTP are described in the
Section on Establishing Data Connections.
satisfy all these ditions. Therefore, these types have a second parameter
specifying one of the following three formats:
FTP COMMANDS:
USER NAME
The argument field is a string identifying the user. The user
identification is that which is required by the server for access to its file system.
This command will normally be the first command transmitted by the user after
the control connections are made (some servers may require this). Additional
identification information in the form of a password and/or an account command
may also be required by some servers. Servers may allow a new USER
command to be entered at any point in order to change the access control
and/or accounting information. This has the effect of flushing any user,
password, and account information already supplied and beginning the login
sequence again. All transfer parameters are unchanged and any file transfer
in progress is completed under the old access control parameters.
PASSWORD
The argument field is a Telnet string specifying the user's
password. This command must be immediately preceded by the user name
command, and, for some sites, completes the user's identification for access
control. Since password information is quite sensitive, it is desirable in
general to "mask" it or suppress typeout. It appears that the server has no
foolproof way to achieve this. It is therefore the responsibility of the user-FTP
process to hide the sensitive password information.
DATA PORT
The argument is a HOST-PORT specification for the data
port to be used in data connection. There are defaults for both the user and
server data ports, and under normal circumstances this command and its reply
are not needed. If this command is used, the argument is the concatenation of a
32-bit internet host address and a 16-bit TCP port address. This address
information is broken into 8-bit fields and the value of each field is transmitted as
a decimal number (in character string representation). The fields are separated
by commas.
DELETE
This command causes the file specified in the pathname to
be deleted at the server site. If an extra level of protection is desired (such as
the query, "Do you really wish to delete?"), it should be provided by the user-FTP
process.
REMOVE DIRECTORY
This command causes the directory specified in the
pathname to be removed as a directory (if the pathname is absolute) or as a
subdirectory of the current working directory (if the pathname is relative
MAKE DIRECTORY
This command causes the directory specified in the
pathname to be created as a directory (if the pathname is absolute) or as a
subdirectory of the current working directory (if the pathname is relative). See
Appendix II.
LIST
This command causes a list to be sent from the server to
the passive DTP. If the pathname specifies a directory or other group of files,
the server should transfer a list of files in the specified directory. If the pathname
specifies a file then the server should send current information on the file. A null
argument implies the user's current working or default directory. The data
transfer is over the data connection in type ASCII or type EBCDIC. (The
user must ensure that the TYPE is appropriately ASCII or EBCDIC). Since the
information on a file may vary widely from system to system, this information
may be hard to use automatically in a program, but may be quite useful to a
human user.
INTRODUCTION:
sufficiently take into consideration the effects of hierarchical proxies, caching, the
need for persistent connections, or virtual hosts. In addition, the proliferation of
incompletely implemented applications calling themselves "HTTP/1.0" has
necessitated a protocol version change in order for two communicating
applications to determine each other's true capabilities.
ANALYSIS
connection
A transport layer virtual circuit established between two programs for the purpose
of communication.
message
The basic unit of HTTP communication, consisting of a structured sequence of
octets and transmitted via the connection.
request
An HTTP request message.
response
An HTTP response message.
resource
A network data object or service that can be identified by a URI. Resources may
be available in multiple representations (e.g. multiple languages, data formats,
size, and resolutions) or vary in other ways.
entity
The information transferred as the payload of a request or
response. An entity consists of metainformation in the form of entity-
header fields and content in the form of an entity-body.
representation
An entity included with a response that is subject to content negotiation.
content negotiation
The mechanism for selecting the appropriate representation when servicing a
request. The representation of entities in any response can be negotiated
(including error responses).
variant
A resource may have one, or more than one, representation(s) associated with it
at any given instant. Each of these representations is termed a `varriant'. Use of
the term `variant' does not necessarily imply that the resource is subject to
content negotiation.
client
A program that establishes connections for the purpose of sending requests.
user agent
The client which initiates a request. These are often browsers, editors, spiders
(web-traversing robots), or other end user tools.
server
An application program that accepts connections in order to service requests by
sending back responses.
origin server
The server on which a given resource resides or is to be created
.
proxy
An intermediary program which acts as both a server and a client for the purpose
of making requests on behalf of other clients. Requests are serviced internally or
by passing them on, with possible translation, to other servers .
gateway
A server which acts as an intermediary for some other server. Unlike a proxy, a
gateway receives requests as if it were the origin server for the requested
resource; the requesting client may not be aware that it is communicating with a
gateway.
first-hand
A response is first-hand if it comes directly and without unnecessary delay from
the origin server, perhaps via one or more proxies. A response is also first-hand if
its validity has just been checked directly with the origin server.
upstream/downstream
Upstream and downstream describe the flow of a message: all messages flow
from upstream to downstream.
Inbound/outbound
Inbound and outbound refer to the request and response paths for messages:
"inbound" means "traveling toward the origin server", and "outbound" means
"traveling toward the user agent"
Overall operation:
Requet
chain
O
UA
Response
chain
i) Http URL
The following is an example of a URL which addresses the Java Web site
hosted by Sun Microsystems:
• Protocol identifier
• Resource name
Note that the protocol identifier and the resource name are
separated by a colon and two forward slashes. The protocol identifier indicates
the name of the protocol to be used to fetch the resource. The example uses the
Hypertext Transfer Protocol (HTTP), which is typically used to serve up hypertext
documents. HTTP is just one of many different protocols used to access different
types of resources on the net. Other protocols include File Transfer Protocol
(FTP), Gopher, File, and News.
Host Name The name of the machine on which the resource lives.
Filename The pathname to the file on the machine.
Port
The port number to which to connect (typically optional).
Number
A reference to a named anchor within a resource that usually
Reference
identifies a specific location within a file (typically optional).
a) Verifiability:
The design is concerned with how easily the correctness of
the design can be argued.
b) Tracability:
This property can aid design verification. It requires all design
elements to be traceable to the requirements.
c) Completeness:
All the different components of the design i.e. relevant data
structures, modules, external interfaces and module interconnections are
specified
d) Efficiency:
It is concerned with the proper use of scarce resources by the
system.
e) Simplicity and Understand ability:
A simple design is likely to have a high degree of independence
between modules. During maintenance, the maintainer has a thorough
understanding of the different modules of the system, how the modules are
interconnected, how modifying one will affect the other, should the modification
be undertaken.
Design of Classes:
This step involves looking at the complete details that each
class represents. The important issue is to decide what functions are to be
provided.
HTTP Module
This module provides the basic navigator function to navigate over
the “web pages”. Also it consists of several sub-modules, which provides
all the basic functionalities that we normally encountered in “Internet
Explorer”. Accordingly this module consists of several sub-modules, which
are
History Module
Favorite Module
View Source Module
MailHandler Module
Print Module
FTP Module
This Module makes it possible to communicate with the FTP server.
Once we connect to the FTP server we can perform the basic “Uploading”
and “Downloading” operations with FTP server.
E-Cabinet Module
This module provides the facility to store text files in the server
address space in the intended user’s login. This module is implemented
using JAVA
“Socket “ and “Server Socket” classes.
Next
Page
HTTPHandle Requested
r History page Will be
Displayed
HTML
View Document will
Source be opened
Favor
Add to Favorites
ites
Request for
Previous page
Retrieve
Previous
page from
History
URL Address
HTTP Previous
Handle
Previous Page
will be
displayed
Request
for next
page
Retrieve
HTTP Next page
URL Address NEXT
Handle from
History
Next page
will be
displayed
Level –ii DFD of HTTP Next Page
URL Address HTTP Favorite
Handler s
Add to Best
Favorite Links
s
The Current
Page will be
Add to added to
Favorite Favorites
s
Favorite
s
Selected Best
Best link Page will
Links List Of
Best Links be displayed
List of Pages
that U had
visited will
be displayed
The selected
Page will be
History OPEN Displayed
HTTP
URL Address Handler View
Source
Source code of
the URL will
be displayed
Open an URL
Connection with
the Requested
URL
Retrieve the
HTML file
using Input
Stream Object
UP
Load
D
OWN
Load
Connection
with server FTP Handler MAKE Processing the
Director user request
y
DELET
E
Director
DELET
E File
User
Request
User
Request
FTP Select the
Handler Download file U want
File to download
Selected File
will be
downloaded
Directory will
be created
myFtp.mkdi
r (dirName)
User
Server
Request
Side
FTP MAKE
Handler Director
y
Client or
Local
Side dir.mkdir(
)
Directory will
be Created
Level –ii DFD For “MAKING Directory” Function
User
Request
FTP
Handle myFtp.rmdir
(dirname)
Server
Side
Directory will
be deleted
DELETE
Directory
Client or
Local
Side dir.delete()
Directory will
Level - ii DFD for FTP DELETE Directory Function be deleted
Server OldFileName.ren
User ameTo (new
Side
Request Filename)
FTP
Rename
Handle
r Selected
Client directory will
Side be renamed
myFtp.mv(oldname,newN
ame)
Selected
directory will
be renamed
START
Warning
message Valid Requested
PREVIOUS HTTP page will be
VIEW
will be
PAGE NEXT PAGEURL ? ADD to
NO Handler YES displayed
Source
displayed Favorites
Return
URL Address
MAIL
Handler
USER
request
HTTP Handler
Retrieve
Previous page
from History
YES
Previous Display the Page
page exists ?
NO
Display the
Current Page
Return
NEXT
NEXT PAGE
Next page
Retrievethe
Display Next
exists? USER
page from
Current Page
HTTP Handler
History request Display the Page
YES
NO
Return
ADF
Current URL
address
NO
The URL
IF it is not address will
already added ? not be added
YES
Return
VIEW
URL address
YES
HTML document
If the URL of the URL will be
is valid ? displayed
NO
Warning
message will be Return
displayed
MAH
Source address,
Destination address,
Message
User input
MAIL Handler
Connection with
SMTP mail
server
NO
Connection Message may not
Established? be send
YES
Message will be
4.6.2 FTP Module
sent Return
START
Information for
Connection
Connection
with Requested
Server
NO
Connection Not valid
Information
UP LOAD Established?
the File DOWN USER
MAKE DELETE
Load the request
Directory
YES Directory
Retur
n
RENAME DELETE
File File
MKD DEL RN
UP MKDDWN M
DEF
MAKE
Directory
YES
Enter the Directory
Client Side?
Name
NO
Enter the Directory
Error Messg will If Messgthe
Directory
Error will
Name
be displayed
YES Directory
be displayed
will not
YESbe
NO
NO
If the Directory will be
Directory created
Directory will be
created
Directory
will not be
created
Return