Upload
govind-mathe
View
215
Download
0
Embed Size (px)
Citation preview
8/6/2019 Mansh Kavishar
1/53
A
PROJECT
ON
FILE ZIPPER
Submitted to
Rashtrasant Tukdoji Maharaj Nagpur University,
Nagpur.
In partial Fulfillment of
MASTER OF BUSINESS ADMINISTRATION
Guided By
Submitted by
Manish R. Kavishwar
MBA final year
(Session 2009 2011)
PRIYADARSHINI COLLEGE OF ENGINEERING
DEPARTMENT OF BUSINESS MANAGEMENT
Hingna Road, Nagpur (M.S.)
8/6/2019 Mansh Kavishar
2/53
CERTIFICATE
This is to certify that the project report entitled FILE ZIPPER Submitted to Rashtrasant
Tukdoji Maharaj Nagpur University, Nagpur in partial fulfillment of the requirement for the
award of the degree of Master of Business Administration (MBA), is original work carried out
by Manish R Kavishwar under my guidance.
The matter embodied in this project is genuine work done by the student and has not been
submitted whether to this university or to any other university institute for the fulfillment of the
requirement of any course of study.
Dr. M. P. Singh Ujwala Dange
Project Guide Principal, HODDept of MBA PCE, Nagpur Dept of MBA
Signature of external Signature of internal
Date-
Manish R. Kavishwar
8/6/2019 Mansh Kavishar
3/53
ACKNOWLEDGEMENT
I would to like covey my heartiest gratitude to several people, for their support and
guidance which helped me in completing my project. My special thanks to HOD Prof. Dr. Mrs.
UJWALADANGE for her constant encouragement throughout this period.
My special thanks to friends, supported me throughout my internship program and
with whose support I could complete my work efficiently and effectively. Their constant support
I motivated throughout the program.
I am surely indebted to the authors of the various books on information technology
that I had the chance to read in my first year of MBA and to the countless other authors, from
whom I was able to learn, during my waking hours.
Thank you!
Manish R. Kavishwar
8/6/2019 Mansh Kavishar
4/53
PREFACE
As a student of Management, it is a great pleasure to undergo project work training.
In our MBA program at Priyadarshini College of Engineering Department of Business
Management (Nagpur University) we are required to take project. So it is great pleasure for me
to complete my project work. It was really my enriching experience for me.
The project report contains brief information about FILE ZIPPER
I have tried my level best for preparing this report as accurately as possible in an
unbiased.
Manish R. Kavishwar
8/6/2019 Mansh Kavishar
5/53
DECLARATION
Sir,
I hereby declare that this project on FILE ZIPPER has been submitted by
MANISH R KAVISHWAR towards partial fulfillment for the requirement of the degree
Master of Business Administration (MBA) for the academic session 2009-2011, is
accomplished by me and submitted in original to the R. T. M. Nagpur University, Nagpur to
the best my knowledge.
All the above information is true to my knowledge.
MANISH R KAVISHWAR.
8/6/2019 Mansh Kavishar
6/53
INDEX
Sr.
No.
Chapter Page No.
1 Executive Summary 1
2 Introduction To Project 2
a) Objective Of Project 9
b) Scope Of Study 10
c) Limitation 11
d) Literature Study 12
3 Flow chart 22
4 Source Code 23
5 Output 31
6 Conclusion 38
7 Reference 39
8 Bibliography 40
8/6/2019 Mansh Kavishar
7/53
CHAPTER- 1
EXECUTIVE
SUMMARY
8/6/2019 Mansh Kavishar
8/53
EXECUTIVE SUMMARY
Project provides a facility to secure a file from unwanted user. To prevent the data, we are encrypting the file to
prevent the file and to reach at destination safely without any interruption. We have provided encryption and
decryption of file and we can email that file through internet. We can convert it into undesirable format to be
confidential. The receiver will then change that encrypted means decrypt the file so, we can safe the file from
hacking, but the receiver will halved that project. This project useful in companies, organization. We can do this
through member or tool bar.
Navigation:
Plaintext -- encrypt -- Cipher text -- decrypt -- plaintext
Benefits:
1. Improve the knowledge of VB programming.
2. Use security of the file.
3. Easy to handle this software.
4. Use only Authorize person.
Objective:
As we know, security is the priority of life. If you are businessman, Industrialist or any employee wanted to secure
data from hacking. Proposed nowadays every field has computer system. Every work can be done by computer
system can resolve the problem of security of important file. Security of documents or data is necessary when you
are working in a big Organization, Institute .Such confidential documents can secured through this project.
8/6/2019 Mansh Kavishar
9/53
CHAPTER-2
INTRODUCTION TOTOPIC
8/6/2019 Mansh Kavishar
10/53
INTRODUTION TO JAVA PROGRAMMING
The Java Story
Back in 1990, a gentleman by the name of James Gosling was given the task of creating programs to
control consumer electronics. Gosling and his team of people at Sun Microsystems started designing their software
using C++, the language that most programmers were praising as the next big thing because of its object-orientednature. Gosling, however, quickly found that C++ was not suitable for the projects he and his team had in mind.
They ran into trouble with complicated aspects of C++ such as multiple inheritances of classes and with program
bugs such as memory leaks. Gosling soon decided that he was going to have to come up with his own, simplified
computer language that would avoid all the problems he had with C++.
Introducing Java
By now, everyone may be curious why Java is considered such a powerful tool for Internet development
projects. We already know that Java is a simplified version of C++. Anyone who has struggled with learning C++
knows that the key word in the previous sentence is "simplified." C++ added so much to the C language that even
professional programmers often have difficulty making the transition.
8/6/2019 Mansh Kavishar
11/53
According to Sun Microsystems, Java is "simple, object-oriented, statically typed, compiled, architecture
neutral, multi-threaded, garbage collected, robust, secure, and extensible." That's a mouthful, but this description of
Java probably doesn't help to understand the language much. The following list of Java's attributes, however, should
clear out some of the cobwebs:
Simple. Java's developers deliberately left out many of the unnecessary features of other high-level
programming languages. For example, Java does not support pointer math, implicit type casting, structures
or unions, operator overloading, templates, header files, or multiple inheritance.
Object-oriented. Just like C++, Java uses classes to organize code into logical modules. At runtime, a
program creates objects from the classes. Java classes can inherit from other classes, but multiple
inheritances, wherein a class inherits methods and fields from more than one class, are not allowed.
Statically typed. All objects used in a program must be declared before they are used. This enables the Java
compiler to locate and report type conflicts.
Compiled. Before user can run a program written in the Java language, the Java compiler must compile the
program. The compilation results in a "byte-code" file that, while similar to a machine-code file, can be
executed under any operating system that has a Java interpreter. This interpreter reads in the byte-code file
and translates the byte-code commands into machine-language commands that can be directly executed by
the machine that's running the Java program. One could say, then, that Java is both a compiled and
interpreted language.
8/6/2019 Mansh Kavishar
12/53
Multi-threaded. Java programs can contain multiple threads of execution, which enables programs to
handle several tasks concurrently. For example, a multi-threaded program can render an image on the
screen in one thread while continuing to accept keyboard input from the user in the main thread. All
applications have at least one thread, which represents the program's main path of execution.
Garbage collected. Java programs do their own garbage collection, which means that programs are notrequired to delete objects that they allocate in memory. This relieves programmers of virtually all memory-
management problems.
Robust. Because the Java interpreter checks all system access performed within a program, Java programs
cannot crash the system. Instead, when a serious error is discovered, Java programs create an exception.
This exception can be captured and managed by the program without any risk of bringing down the system.
Secure. The Java system not only verifies all memory access but also ensures that no viruses are hitching a
ride with a running applet. Because pointers are not supported by the Java language, programs cannot gain
access to areas of the system for which they have no authorization.
Extensible. Java programs support native methods, which are functions written in another language, usually
C++. Support for native methods enables programmers to write functions that may execute faster than the
equivalent functions written in Java. Native methods are dynamically linked to the Java program; that is,
they are associated with the program at runtime. As the Java language is further refined for speed, native
methods will probably be unnecessary.
Well-understood. The Java language is based upon technology that's been developed over many years. For
this reason, Java can be quickly and easily understood by anyone with experience with modern
programming languages such as C++.
As one can tell from the preceding list of features, a great deal of thought went into creating a language that
would be fairly easy to use but still provide the most powerful features of a modern language like C++. Thanks to
features such as automatic garbage collection, programmers can spend more time developing their programs rather
than wasting valuable man-hours hunting for hard-to-find memory-allocation bugs. However, features such as Java's
object-oriented nature, as well as its ability to handle multiple threads of execution, ensure that the language is both
up-to-date and powerful.
The Java Developer's Kit
Java is actually more than a computer language; it's also a programming environment that includes a
complete set of programming tools. These tools include a compiler, an interpreter, a debugger, a disassembler, a
profiler, and more. To create a Java program, first use a text editor to create the source-code file. Users write the
source code, of course, in the Java language. After completing the source code, which is always saved with a .java
file extension, compile the program into its byte-code format, the file for which has the .class file extension. It is
8/6/2019 Mansh Kavishar
13/53
the .class file that the interpreter loads and executes. Because the byte-code files are fully portable between
operating systems, they can be executed on any system that has a Java interpreter.
After compiling and running a Java program, one may discover that the source code needs modification. The Java
debugger can help to find errors, whereas the Java profiler provides handy information about program. If users run
into a compiled Java program that like to see in source-code form, the Java disassembler will do the translation. Java
also includes a program that creates the files need to take advantage of native methods (functions written in another
language, such as C++). There's even a program that can create HTML documents from Java source-code files.
Although all the development tools are DOS applications-that is, they don't run under Windows-they provide a
complete environment for creating and managing Java projects.
The development environment for Java is surprisingly rich, especially considering that the Java
programming language is fairly new. Most Java developers and programmers find that the JDK contains everything
they need to get started creating powerful Java programs. This is because the developer's kit includes the Java
programming language core functionality, the Java Application Programming Interface (API) complete with
multiple package sets, and essential tools for creating Java programs.The Java Developer's Kit is currently available for most operating systems. One can obtain the Sun Solaris,
Windows 95/NT, and Macintosh versions directly from JavaSoft. Because the Java Soft FTP site is extremely busy.
The heart of the Java programming language is contained in a set of packages called java.lang, which is a part of the
Java Application Programming Interface. Although the java.lang package provides the core functionality of the Java
programming language, it is not the only package included in the Java Developer's Kit.
The JDK includes the following packages: java.applet, java.awt, java.awt.image, java.awt.peer, java.io,
java.lang, java.net, and java.util. These packages provide everything to start creating powerful Java applications
quickly. The JDK also includes an additional package called sun.tools.debug, which is designed to make the
application-debugging process easier.
.
Package Package Name Description
java.applet Applet
A set of classes that relate to the applet
environment and are generally used
when viewing applets
java.awt Abstract WindowingToolkit
A set of classes that provide graphical
interface tools such as buttons, controls,
scrollbars, and windows
java.awt.image AWT Image A set of classes related to using images
java.awt.peer AWT Peer A set of classes for AWT peer classes
and methods
java.sql Database connectivity A set of classes that enable developers to
8/6/2019 Mansh Kavishar
14/53
write Java applications that access
databases
java.io I/OA set of classes that provide standard
input/output and file I/O utilities
java.lang Language
The core set of classes for the Java
language that provide basic functions,
such as string and array handling
java.net Network
A set of classes that provide tools for
accessing networks by protocols, such as
FTP, Telnet, and HTTP
java.util Utility
A set of classes that provide core utility
functions such as encoding/decoding,
hash tables, and stacks
sun.tools.debug DebugA set of classes that provide debugging
functions and tools
Java Programs
Java is first and foremost an object-oriented programming language. Many programmers are surprised
when they discover how easy it is to follow sound object-oriented design practices with Java. Java can be used to
create two types of programs: applets and stand-alone applications. An Applet is simply a part of a Web page, just as
an image or a line of text can be. Just as a browser takes care of displaying an image referenced in an HTML
document, a Java-enabled browser locates and runs an Applet . When Java-capable Web browser loads the HTML
document, the Java applet is also loaded and executed.
Using applets, one can do everything from adding animated graphics to our Web pages to creating
complete games and utilities that can be executed over the Internet. Some applets that have already been created
with Java include Bar Chart, which embeds a configurable bar chart in an HTML document; Crossword Puzzle,
which enables users to solve a crossword puzzle on the Web; and LED Sign, which presents a scrolling,
computerized message to viewers of the Web page within which the applet is embedded.
8/6/2019 Mansh Kavishar
15/53
Advantages and disadvantages
Compressing files separately, as is done in ZIP files, allows for random access: individual
files can be retrieved without reading through other data. It may allow better overall
compression by using different algorithms for different files. Even when confining the
possibility to DEFLATE compression, the use of different compression dictionaries for
each file may result in a smaller archive overall.
This approach is less well-suited, in general, to archival of a large number of small files.
In the ZIP archive format, the metadata for each entrythe information about each
individual entryis not compressed. This limits the maximum achievable compressionratio, especially as the size of the individual entries diminishes and approaches the size of
the metadata for the entry.
An alternate approach is used in a compressed tar archive (.tar.gz, or.tgz), in which
the file data and metadata is compressed as a unit using gzip. The downside of this
approach is the loss of random-access efficiency
http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Gziphttp://en.wikipedia.org/wiki/Tar_(file_format)http://en.wikipedia.org/wiki/Gzip8/6/2019 Mansh Kavishar
16/53
OBJECTIVE:
As we know, security is the priority of life.
If you are businessman, Industrialist or any employee wanted to secure data from hacking.
Proposed nowadays every field has computer system.
Every work can be done by computer system can resolve the problem of security of important file. Security
of documents or data is necessary when you are working in a big Organization, Institute .Suchconfidential documents can secured through this project
8/6/2019 Mansh Kavishar
17/53
SCOPE
Purpose
Provides an example of the "vision and scope" document typically used to summarize the high-
level vision of the desired product during a software development project.
Contains:
a PDF document explaining the contents of the various sections of the document
an example "vision and scope" document, in PDF format
Setup
Place the downloaded zip file in an appropriate folder and extract the files contained in the
archive.
Requirements
WinZip, PKZIP or similar software to unload the provided ZIP file
Software that will allow reading of PDF documents.
Versions available for download
vision_and_scope_example.zip (266 Kb zip file, 08Oct2003 revision)
Planned Development
No modifications/revisions currently planne.
http://www.nw-data-centric.com/downloads/files/vision_and_scope_example.ziphttp://www.nw-data-centric.com/downloads/files/vision_and_scope_example.zip8/6/2019 Mansh Kavishar
18/53
LIMITATIONS
1 The minimum size of a ZIP file is 22 bytes.
2 The maximum size for both the archive file and the individual files inside it is
4,294,967,295 (232-1, 4 Gigabyte) bytes for standard ZIP, and 18,446,744,073,709,551,615 (264-
1, 16 Exabyte) for ZIP64.[14]
3 Project can be made multipurpose
http://en.wikipedia.org/wiki/ZIP_(file_format)#cite_note-ziplimit-13%23cite_note-ziplimit-13http://en.wikipedia.org/wiki/ZIP_(file_format)#cite_note-ziplimit-13%23cite_note-ziplimit-138/6/2019 Mansh Kavishar
19/53
LITERATURE STUDY
The Primary Characteristics of Java
The ease with which one can transition to Java from C/C++ and Java's object-oriented capabilities are only the
icing on the cake. Java has many powerful characteristics, most of which are
Architecture-neutral
Distributed
Dynamic
Interpreted and compiled
Multithreaded
Network-ready and compatible
Object-oriented
Portable
Robust
Secure
These characteristics are the source of Java's power and the reason for Java's widespread popularity. Many of
these characteristics are interrelated and are a direct outgrowth of Java's development for the following:
Distributed networked environments
High performance
Easy reuse of code
Security
8/6/2019 Mansh Kavishar
20/53
Object-Oriented Programming
Object-oriented programming enables to think of program elements as objects. In the case of a window object, users
don't need to know the details of how it works, nor do users need to know about the window's private data fields.
Users need to know only how to call the various functions (called methods in Java) that make the window operate.
Consider the car object discussed in the previous section. To drive a car, users don't have to know the details of how
a car works. Users need to know only how to drive it. What's going on under the hood is none of business. (And, if
one casually try to make it your business, plan to face an amused mechanic who will have to straighten out mess)
But OOP is a lot more than just a way to hide the details of a program. To learn about OOP, one needs to
understand three main concepts that are the backbone of OOP. These concepts, which are covered in the following
sections, are: encapsulation, inheritance, and polymorphism.
Objects
The fundamental unit in object-oriented programming is the object. Languages that follow object-oriented concepts
describe the interaction among objects. All objects have a state and a behavior.The state of an object pertains to data elements and their associated values. Everything the object knows
about these elements and values describes the state of the object. Data elements associated with objects are called
instance variables.
The behavior of an object depends on the actions the object can perform on the instance variables defined within the
object. In procedural programming, such a construct would be called a function. In object-oriented terminology, this
construct is called a method. A method belongs to the class it is a member of, and one can use a method when he
need to perform a specific action more than once.
Thus, the state of an object depends on the things the object knows, and the behavior of the object depends
on the actions the object can perform. If user creates a software object that models the television, the object would
have variables describing the television's current state, such as it is on, the current channel setting is 8, the current
volume setting is 23, and there is no input coming from the remote control. The object would also have methods that
describe the permissible actions, such as turn the television on or off, change the channel, change the volume, and
accept input from the remote control.
Encapsulation
One major difference between conventional structured programming and object-oriented programming is a
handy thing called encapsulation. Encapsulation enables to hide, inside the object, both the data fields and the
methods that act on that data. (In fact, data fields and methods are the two main elements of an object in the Java
programming language.) After do this, users can control access to the data, forcing programs to retrieve or modify
data only through the object's interface. In strict object-oriented design, an object's data is always private to the
object. Other parts of a program should never have direct access to that data.
8/6/2019 Mansh Kavishar
21/53
How does this data hiding differ from a structured-programming approach? After all, one can always hide
data inside functions, just by making that data local to the function. A problem arises; however, when one want to
make the data of one function available to other functions. The way to do this in a structured program is to make the
data global to the program, which gives any function access to it. It seems that users could use another level of
scope-one that would make your data global to the functions that need it-but still prevent other functions from
gaining access. Encapsulation does just that. In an object, the encapsulated data members are global to the object's
methods, yet they are local to the object. They are not global variables.
Classes as Data Types
An object is just an instance of a data type. For example, when you declare a variable of type int, you're
creating an instance of the int data type. A class is like a data type in that it is the blueprint upon which an object isbased. When users need a new object in a program, one can create a class, which is a kind of template for the object.
Then, in program, users create an instance of the class. This instance is called an object.
Classes are really nothing more than user-defined data types. As with any data type, users can have as
many instances of the class as users want. For example, users can have more than one window in a Windows
application, each with its own contents.
Classes encapsulate objects. A single class can be used to instantiate multiple objects. This means that one
can have many active objects or instances of a class. The object describing the functions of television is an instance
of a class of objects called television.
Each object within a class retains its own states and behaviors. By encapsulating objects within a class structure, one
can group sets of objects by type. The Java Application Programming Interface (API) describes many classes. Each
class in the API specifies a set of objects that perform related functions and share common characteristics. Classes
programmer create can serve a similar purpose
For example, think again about the integer data type (int). It's absurd to think that a program can have only
one integer. One can declare many integers, just about all. The same is true of classes. After one defines a new class,
it can create many instances of the class. Each instance (called an object) normally has full access to the class's
methods and gets its own copy of the data members.
Inheritance
Inheritance enables to create a class that is similar to a previously defined class, but one that still has some
of its own properties. Consider a car-simulation program. Suppose that anyone have a class for a regular car, but
8/6/2019 Mansh Kavishar
22/53
now users want to create a car that has a high-speed passing gear. In a traditional program, users might have to
modify the existing code extensively and might introduce bugs into code that worked fine before changes. To avoid
these hassles, one can use the object-oriented approach: Create a new class by inheritance. This new class inherits all
the data and methods from the tested base class. Users can control the level of inheritance with the public, private,
and protected keywords.
Libraries
In C++ and other programming languages, a collection of related classes or functions is called a library.
Java puts a twist on the concept of libraries by using the term package to describe a collection of related classes. Just
as classes encapsulate objects, packages encapsulate classes in Java.
Polymorphism
The last major feature of object-oriented programming is polymorphism. By using polymorphism, one can
create new objects that perform the same functions as the base object but which perform one or more of these
functions in a different way. For example, user may have a shape object that draws a circle on the screen. By using
polymorphism, one can create a shape object that draws a rectangle instead. User does this by creating a new version
of the method that draws the shape on the screen. Both the old circle drawing and the new rectangle-drawing method
have the same name but accomplish the drawing in a different way.
PROJECT DESCRIPTIONS
As one part of the project, we implemented a sliding window protocol which is a bidirectional protocol, at
any instant of time; the sender maintains a set of sequence numbers corresponding to frames it is permitted to send.
These frames are said to fall within the sending window and the receiver also maintains a receiving window
corresponding to the set of frames it is permitted to accept. The senders window and the receivers window neednot have the same lower and upper limits or even have the same size. In some protocols they are fixed in size, but in
others they can grow or shrink over the course of time as frames are sent and received.
IMPLEMENTATION
8/6/2019 Mansh Kavishar
23/53
This section illustrates the basic requirement of the project. The hardware and software support is also given. The
system is developed based on the design issues.
Hardware and Software Requirements:-
Software:
Platform : Windows95\98\XP Operating system.
MS Dos Prompt
Java Development Kit 1.3
Hardware Requirement:
Pentium processor with minimum of 133 MHz
of processing speed.
METHODS IN DEVELOPMENT OF THE SOFTWARE:
.In this project, following functions are used and their operations are described here.
1. Init ( ): - Function init ( ) initializes the Routing Table with default values for the link
propagation delays between the links, as specified in the figure.
2. getappletinfo( ):-This function return applet information.
3. actionPerformed ( ): - Function actionPerformed ( ) perform the action.
4. Start( ): - Function Start( ) simulate the start and create a new thread. .
5. Stops():- Function Stops() stop and reset simulation and destroy the thread..
6. PauseorResume():-Function PauseorResume() Freeze or resume simulation.
7. run( ): -Function run() thread control method.
8. changedir(): - The changedir() function reverse the direction of packet
9. settype():- This function set the type of data packet.
10. setlossno():- This function set the packet number that are loss .
11. setmaxseq:- This function set the maximum sequence number of packet.12. paint():- This function has graphics variable and return void graphics of program.
13. update():-This function has graphics variable and return void and do not clear the
background every time.
14. changeturn():-This function change the turn of packet.
15. nextxy():-The method nextxy() calculates the next position of the frame.
8/6/2019 Mansh Kavishar
24/53
8/6/2019 Mansh Kavishar
25/53
AudioClip Template for implementing audio objects
2.import java.awt:-
AWT stands for Abstract Windowing Toolkit. As its name suggests, AWT libraries
involve the GUI (graphical user interface) parts of Java, including such elements as boxes,
buttons, borders, and menus. Table(b) and (c) present a list ofjava.awt interfaces and classes.
Table(b) java.awt interfaces.
Interface Usage
LayoutManager Template for classes implementing layout containers
MenuContainer Template for classes implementing menu containers
Table(c) java.awt classes.
Class Name Description
BorderLayout Methods for handling border layouts
Button Methods for manipulating Button objects
Canvas Generic template for implementing canvases
CardLayout Methods for manipulating Rolodex-style card objects
Checkbox Methods for manipulating Checkbox objects
CheckboxGroup Methods for manipulating groups of Checkbox objects
CheckboxMenuItem Methods for manipulating Checkbox-style menus
8/6/2019 Mansh Kavishar
26/53
Choice Methods for manipulating pop-up choice options
Color Methods for manipulating colors
Component Generic class for implementing AWT components
Container Generic class for implementing AWT containers
Dialog Methods for manipulating a pop-up dialog box
Dimension Wrapper for representing width and height
Event Methods for manipulating user input events
FileDialog Methods for manipulating a file dialog box
FlowLayout Methods for manipulating flow of Window objects
Font Methods for manipulating fonts
FontMetrics Methods for manipulating font characteristics
Frame Methods for handling frames
Graphics Abstract superclass to all Graphics objects
GridBagConstraints Methods for placing restraints on GridBag layouts
GridBagLayout Methods for placing objects in a window in a specified wayGridLayout Methods for manipulating grid layout containers
Image Abstract class for implementing platform-specific images
Insets Methods for manipulating insets in containers
Label Methods for manipulating labels
List Methods for manipulating lists
MediaTracker Methods for tracking media objects
Menu Methods for manipulating menus
MenuBar Methods for manipulating menu bars
MenuComponent Superclass to all menu objects
MenuItem Methods for manipulating menu itemsPanel Generic class for implementing panel containers
Point Wrapper for representing points
Polygon Wrapper for representing polygons
Rectangle Wrapper for representing rectangles
Scrollbar Methods for manipulating scrollbars
TextArea Methods for manipulating text areas
TextComponent Superclass to all text objects
TextField Methods for manipulating single lines of text
Toolkit Class used to bind the AWT to a specific implementation
Window Methods for manipulating a Window object
8/6/2019 Mansh Kavishar
27/53
CHAPTER- 3
FLOW CHART
8/6/2019 Mansh Kavishar
28/53
FLOW CHART
Error: Reference source not found
MAIN
MENU
Unzip
Unreadable
Zip
Open
Exit
8/6/2019 Mansh Kavishar
29/53
CHAPTER 4
SOURCE CODE
8/6/2019 Mansh Kavishar
30/53
SOURCE CODE
Main Class
import java.util.zip.*;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.border.*;
class gzipp extends JFrame implements ActionListener
{
static final String windows="com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
String className;
JFileChooser fileChooser;
int result,fnmlen;
File fileName;
String fname="",outFilename,inFilename,xtn,xtn1,ofname;
JButton open,zip,unzip,exit;JMenuBar mbr;
JMenu File,Help;
JLabel l1;
JMenuItem Open,GZip,UnGZip,Exit,About,Open1,GZip1,UnGZip1,Exit1,About1;
Container con;
JPanel pm,p;
8/6/2019 Mansh Kavishar
31/53
CompoundBorder cb,cb1;
ImageIcon imic,imic1,plain,about,xit,pen,press,rem,elp,anixit;
JPopupMenu popup;
int option=JOptionPane.YES_NO_OPTION;
JProgressBar pb;
public gzipp()
{
UIManager.LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
int o=lafInfo.length;
for(int y=0;y
8/6/2019 Mansh Kavishar
32/53
p.setBorder(cb1);
mbr=new JMenuBar();
mbr.setBorder(new BevelBorder(BevelBorder.RAISED));
File=new JMenu("File");
Help=new JMenu("Help");
open=new JButton(pen);
open.setToolTipText("Select a file.");
zip=new JButton(press);
zip.setToolTipText("GZip selected file.");
unzip=new JButton(rem);
unzip.setToolTipText("UnGZip selected file.");
exit=new JButton(xit);
exit.setToolTipText("Click to exit");
Open=new JMenuItem("Open");GZip=new JMenuItem("GZip");
About=new JMenuItem("About");
UnGZip=new JMenuItem("UnGZip");
Exit=new JMenuItem("Exit");
Open1=new JMenuItem("Open");
GZip1=new JMenuItem("GZip");
About1=new JMenuItem("About");
File.setIcon(new ImageIcon("File.gif"));
Help.setIcon(new ImageIcon("help.gif"));
UnGZip1=new JMenuItem("UnGZip");
Exit1=new JMenuItem("Exit");
File.add(Open);
File.addSeparator();
File.add(GZip);
File.add(UnGZip);
File.addSeparator();
File.add(Exit);
Help.add(About);
popup.add(Open1);
popup.addSeparator();
popup.add(GZip1);
popup.add(UnGZip1);
popup.addSeparator();
8/6/2019 Mansh Kavishar
33/53
8/6/2019 Mansh Kavishar
34/53
l1.setIcon(anixit);
result=JOptionPane.showConfirmDialog(null,"Are you sure about
Exiting?","GZipper",option,JOptionPane.QUESTION_MESSAGE);
if(result == 1)
{
l1.setText("");
l1.setIcon(plain);
gzipp obj=new gzipp();
}
else
System.exit(0);}});
p.setBackground(new Color(250,150,205));
pm.setBackground(new Color(250,150,205));
/*con.setBackground(new Color(250,150,205));open.setBackground(new Color(150,150,205));
zip.setBackground(new Color(250,220,205));
unzip.setBackground(new Color(250,150,85));
exit.setBackground(new Color(255,130,105));*/
setSize(400,175);
setResizable(false);
setVisible(true);
setTitle("GZipper");
addMouseListener(new MouseAdapter(){
public void mousePressed(MouseEvent me){if(me.isPopupTrigger())
{popup.show(me.getComponent(),me.getX(),me.getY());}}
public void mouseReleased(MouseEvent me){if(me.isPopupTrigger())
{popup.show(me.getComponent(),me.getX(),me.getY());}}});
ToolTipManager.sharedInstance().setInitialDelay(0);
}
public static void main(String arg[])
{
gzipp obj=new gzipp();
}
public void actionPerformed(ActionEvent ae)
{
8/6/2019 Mansh Kavishar
35/53
if(ae.getSource()==exit||ae.getSource()==Exit||ae.getSource()==Exit1)
//close button
{
l1.setText("Exiting");
l1.setIcon(anixit);
result=JOptionPane.showConfirmDialog(null,"Are you sure about
Exiting?","GZipper",option,JOptionPane.QUESTION_MESSAGE);
if(result == 1)
{
l1.setText("");
l1.setIcon(plain);
return;
}
elseSystem.exit(0);
}
if(ae.getSource()==open||ae.getSource()==Open||ae.getSource()==Open1)
//Open button
{
l1.setText("Opening");
l1.setIcon(about);
fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
result = fileChooser.showOpenDialog(null);
if(result == JFileChooser.CANCEL_OPTION)
{
l1.setText("");
l1.setIcon(plain);
return;
}
fileName = fileChooser.getSelectedFile();
fname=fileName.getAbsolutePath();
System.out.println("Selected file is "+fname);
fnmlen=fname.length();
l1.setText("");
l1.setIcon(plain);
8/6/2019 Mansh Kavishar
36/53
}
if(ae.getSource()==zip||ae.getSource()==GZip||ae.getSource()==GZip1)
//Zip button
{
if(!fname.equals("")){
xtn1="."+fname.charAt(fnmlen-4)+fname.charAt(fnmlen-
3)+fname.charAt(fnmlen-2)+fname.charAt(fnmlen-1);
if(!xtn1.equals(".gzip"))
{
l1.setIcon(imic);
l1.setText("GZipping in progress");
xtn="."+fname.charAt(fnmlen-3)+fname.charAt(fnmlen-
2)+fname.charAt(fnmlen-1);
fileChooser = new JFileChooser();fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
result = fileChooser.showSaveDialog(null);
if(result == JFileChooser.CANCEL_OPTION)
{
l1.setText("");
l1.setIcon(plain);
return;
}
fileName = fileChooser.getSelectedFile();
try {
outFilename = fileName.getAbsolutePath()+xtn+".gzip";
GZIPOutputStream out = new GZIPOutputStream(new
FileOutputStream(outFilename));
FileInputStream in = new FileInputStream(fname);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0)
{
out.write(buf, 0, len);
}
in.close();
out.finish();
out.close();
8/6/2019 Mansh Kavishar
37/53
} catch (IOException e) {}
System.out.println("GZipping of "+outFilename+" is complete.");
l1.setText("");
l1.setIcon(plain);
}
else
JOptionPane.showMessageDialog(null,"This File is already
gzipped.","GZipper",JOptionPane.ERROR_MESSAGE);
}
else
JOptionPane.showMessageDialog(null,"No File Selected To
GZipp","GZipper",JOptionPane.WARNING_MESSAGE);
}
if(ae.getSource()==unzip||ae.getSource()==UnGZip||ae.getSource()==UnGZip1)//UnZip button
{
if(!fname.equals("")){
xtn1="."+fname.charAt(fnmlen-4)+fname.charAt(fnmlen-
3)+fname.charAt(fnmlen-2)+fname.charAt(fnmlen-1);
if(xtn1.equals(".gzip"))
{
l1.setIcon(imic1);
l1.setText("UnGZipping in progress");
xtn=fname.substring(fnmlen-9,fnmlen-4);
fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
result = fileChooser.showSaveDialog(null);
if(result == JFileChooser.CANCEL_OPTION)
{
l1.setText("");
l1.setIcon(plain);
return;
}
fileName = fileChooser.getSelectedFile();
try {
8/6/2019 Mansh Kavishar
38/53
GZIPInputStream in = new GZIPInputStream(new
FileInputStream(fname));
FileOutputStream out = new
FileOutputStream(fileName.getAbsolutePath()+xtn);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
out.close();
in.close();
} catch (IOException e) {}
System.out.println("UnGZipping of "+fname+" is complete.");
l1.setText("");l1.setIcon(plain);
}
else
JOptionPane.showMessageDialog(null,"File
format(gzip)Error","GZipper",JOptionPane.ERROR_MESSAGE);
}
else
JOptionPane.showMessageDialog(null,"No File Selected To
UnGZipp","GZipper",JOptionPane.WARNING_MESSAGE);
}
if(ae.getSource()==About||ae.getSource()==About1)
//About button
{
l1.setText("About");
l1.setIcon(about);
JOptionPane.showMessageDialog(null,"
GZipper\nVersion : 1.0\ncreated by : Joe
Oommen","GZipper",JOptionPane.INFORMATION_MESSAGE);
l1.setText("");
l1.setIcon(plain);
}
8/6/2019 Mansh Kavishar
39/53
8/6/2019 Mansh Kavishar
40/53
Output
Login
Main Frame
8/6/2019 Mansh Kavishar
41/53
Open File
Source File
Select File
8/6/2019 Mansh Kavishar
42/53
Zip File
Save File
8/6/2019 Mansh Kavishar
43/53
Unreadable File Format
8/6/2019 Mansh Kavishar
44/53
Unzip File
Open File
8/6/2019 Mansh Kavishar
45/53
Save File
8/6/2019 Mansh Kavishar
46/53
Original File
a
Help
8/6/2019 Mansh Kavishar
47/53
Exit
8/6/2019 Mansh Kavishar
48/53
8/6/2019 Mansh Kavishar
49/53
CONCLUSION
Project provides a facility to secure a file from unwanted user. To prevent the data, we are encrypting the
file to prevent the file and to reach at destination safely without any interrupt
It provides security to data covered in a zipper file from strange person. It protects data from theft &
provides a secured data to the zipper use.
Most of the drive data is maximum to carry or mail to someone, somewhere then there is need to compress
data and file zipper compress data in less memory which provides easiness to carry or mail the data.
We need a secure data & we dont expect someone strange interference and zipper file provides these
facility. Once data is fitted in zipper file then no one can exchange data from it.
Zipper file reduce the time of user.
Most of time our important data is corrupted by viruses or any other threats. And if data is in file zipper
then it protects data from any virus or threats. Zipper file is needed to IT users & later because software
crime & emerging threats are challenges. And zipper file provides (protection) alternative option to it.
8/6/2019 Mansh Kavishar
50/53
CHAPTER 7
REFERENCE
8/6/2019 Mansh Kavishar
51/53
REFERENCES:
SOURCE:
THEFOLLOWINGBOOKSAREUSEDASTHEREFERENCESINDEVELOPMENTOFTHESYSEM.
1 Author: E. Balaguruswami
Object-Oriented Programming with Java
Second Edition,2006 publication: Tata-Mcgraw-Hill
2.Author: Herlet schildt
Complete Reference Java,
Fourth edition, 2006 publication: Tata- Mcgraw-Hill
3. Author: Black Book
Fourth edition Java publication : Tata-Mcgraw-Hill
8/6/2019 Mansh Kavishar
52/53
CHAPTER 8
Bibliography
8/6/2019 Mansh Kavishar
53/53
BIBLIOGRAPHY:
THEFOLLOWINGWEBSITESAREUSEDASTHEREFERENCESINDEVELOPMENTOFTHESYSTEM.
Internet:
www.google.com
www.source code.com