Anda di halaman 1dari 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.)

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 Project Guide Dept of MBA Principal, PCE, Nagpur

Ujwala Dange HOD Dept of MBA

Signature of external Date-

Signature of internal

Manish R. Kavishwar

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. UJWALA DANGE 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

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

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 the best my knowledge. R. T. M. Nagpur University, Nagpur to

All the above information is true to my knowledge.

MANISH R KAVISHWAR.

INDEX Sr. No. 1 2 Chapter Executive Summary Introduction To Project a) Objective Of Project b) Scope Of Study c) Limitation d) Literature Study 3 4 5 6 7 8 Flow chart Source Code Output Conclusion Reference Bibliography Page No. 1 2 9 10 11 12 22 23 31 38 39 40

CHAPTER- 1 EXECUTIVE SUMMARY

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. 2. 3. 4. Improve the knowledge of VB programming. Use security of the file. Easy to handle this software. 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.

CHAPTER-2 INTRODUCTION TO TOPIC

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-oriented nature. 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.

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.

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 not required to delete objects that they allocate in memory. This relieves programmers of virtually all memorymanagement 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

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 java.applet Package Name Applet Description A set of classes that relate to the applet environment and are generally used when viewing applets java.awt java.awt.image java.awt.peer java.sql Abstract Toolkit AWT Image AWT Peer Database connectivity Windowing A set of classes that provide graphical interface tools such as buttons, controls, scrollbars, and windows A set of classes related to using images A set of classes for AWT peer classes and methods A set of classes that enable developers to

write Java applications that access databases java.io I/O A set of classes that provide standard input/output and file I/O utilities The core set of classes for the Java java.lang Language language that provide basic functions, such as string and array handling A set of classes that provide tools for java.net Network accessing networks by protocols, such as FTP, Telnet, and HTTP A set of classes that provide core utility java.util Utility functions such as encoding/decoding, hash tables, and stacks sun.tools.debug Debug A 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.

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 compression ratio, 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

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, confidential documents can secured through this project Institute .Such

SCOPE
Purpose
Provides an example of the "vision and scope" document typically used to summarize the highlevel 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.

LIMITATIONS

The minimum size of a ZIP file is 22 bytes.

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 (2641, 16 Exabyte) for ZIP64.[14]

Project can be made multipurpose

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

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.

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 is based. 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

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 need not 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

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 MS Dos Prompt Java Development Kit 1.3 : Windows95\98\XP Operating system.

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.

16. getx():- This function return the x coordinate. 17. gety():-This function return the y coordinate. 18. sendpacket():- This function has four variable and it perform the sending function. 19. drawpacket():- The drawpacket function draw the packet. 20. drawCircle():-The drawCircle function draw the circle. 21. textValueChanged():-This function change the value of text. 22. itemStateChanged():- The itemStateChanged function changed the state of item.

PACKAGES IMPORT IN DEVELOPMENT OF THE PROJECT:


There are three packages that are used in this project. These are as follows:1. java.applet 2. java.awt 3. java.awt.event 1. import java.applet:The java.applet package contains an applet-specific class-Applet-and several interfaces. The
Applet

class contains the methods init, start, stop, and destroy. In other words, the java.applet package

is used to control the structure and use of applets. Table(a) lists the interfaces for this package. Table(a)
Interface AppletContext AppletStub Usage Template for obtaining information about an applet's environment Template used to implement an applet viewer

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 of java.awt interfaces and classes.
Table(b) java.awt interfaces. Interface LayoutManager MenuContainer Table(c) java.awt classes. Usage Template for classes implementing layout containers Template for classes implementing menu containers

Class Name BorderLayout Button Canvas CardLayout Checkbox CheckboxGroup CheckboxMenuItem

Description Methods for handling border layouts Methods for manipulating Button objects Generic template for implementing canvases Methods for manipulating Rolodex-style card objects Methods for manipulating Checkbox objects Methods for manipulating groups of Checkbox objects Methods for manipulating Checkbox-style menus

Choice Color Component Container Dialog Dimension Event FileDialog FlowLayout Font FontMetrics Frame Graphics GridBagConstraints GridBagLayout GridLayout Image Insets Label List MediaTracker Menu MenuBar MenuComponent MenuItem Panel Point Polygon Rectangle Scrollbar TextArea TextComponent TextField Toolkit Window

Methods for manipulating pop-up choice options Methods for manipulating colors Generic class for implementing AWT components Generic class for implementing AWT containers Methods for manipulating a pop-up dialog box Wrapper for representing width and height Methods for manipulating user input events Methods for manipulating a file dialog box Methods for manipulating flow of Window objects Methods for manipulating fonts Methods for manipulating font characteristics Methods for handling frames Abstract superclass to all Graphics objects Methods for placing restraints on GridBag layouts Methods for placing objects in a window in a specified way Methods for manipulating grid layout containers Abstract class for implementing platform-specific images Methods for manipulating insets in containers Methods for manipulating labels Methods for manipulating lists Methods for tracking media objects Methods for manipulating menus Methods for manipulating menu bars Superclass to all menu objects Methods for manipulating menu items Generic class for implementing panel containers Wrapper for representing points Wrapper for representing polygons Wrapper for representing rectangles Methods for manipulating scrollbars Methods for manipulating text areas Superclass to all text objects Methods for manipulating single lines of text Class used to bind the AWT to a specific implementation Methods for manipulating a Window object

CHAPTER- 3 FLOW CHART

FLOW CHART

Open

Zip

MAIN MENU

Unreadable

Unzip

Exit

Error: Reference source not found

CHAPTER 4 SOURCE CODE

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;

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<o;y++) { className=lafInfo[y].getClassName(); try{ if (className == windows) UIManager.setLookAndFeel(windows); }catch(Exception e){} } popup=new JPopupMenu(); elp=new ImageIcon("help.gif"); anixit=new ImageIcon("help0.gif"); about=new ImageIcon("readebook.gif"); imic=new ImageIcon("Animation1.gif"); imic1=new ImageIcon("uncompress.gif"); xit=new ImageIcon("CNFNOT.gif"); pen=new ImageIcon("open.gif"); press=new ImageIcon("compress.gif");//EventsIcon.gif rem=new ImageIcon("uncompression.gif"); plain=new ImageIcon(); l1=new JLabel("",JLabel.CENTER); con=getContentPane(); con.setLayout(new BorderLayout()); cb=new EtchedBorder(EtchedBorder.RAISED)); cb1=new CompoundBorder(cb,new TitledBorder("Action Panel")); p=new JPanel(); pm=new JPanel(); pm.setLayout(new GridLayout(1,1)); CompoundBorder(new BevelBorder(BevelBorder.RAISED),new

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();

popup.add(About1); popup.addSeparator(); popup.add(Exit1); mbr.add(File); mbr.add(Help); pb=new JProgressBar(JProgressBar.HORIZONTAL,0,500); pb.setBackground(new Color(250,100,205)); pb.setForeground(new Color(250,150,205)); pb.setBorder(new BevelBorder(BevelBorder.RAISED)); pb.setVisible(true); pb.setValue(200); con.add(mbr,BorderLayout.NORTH); pm.add(l1); //pm.add(pb); con.add(pm,BorderLayout.CENTER); p.add(open); p.add(zip); p.add(unzip); p.add(exit); con.add(p,BorderLayout.SOUTH); open.addActionListener(this); zip.addActionListener(this); unzip.addActionListener(this); exit.addActionListener(this); Open.addActionListener(this); Exit.addActionListener(this); GZip.addActionListener(this); UnGZip.addActionListener(this); About.addActionListener(this); Open1.addActionListener(this); Exit1.addActionListener(this); GZip1.addActionListener(this); UnGZip1.addActionListener(this); About1.addActionListener(this); addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent e) {l1.setText("Exiting");

l1.setIcon(anixit); result=JOptionPane.showConfirmDialog(null,"Are 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) { you sure about

if(ae.getSource()==exit||ae.getSource()==Exit||ae.getSource()==Exit1) //close button { l1.setText("Exiting"); l1.setIcon(anixit); result=JOptionPane.showConfirmDialog(null,"Are Exiting?","GZipper",option,JOptionPane.QUESTION_MESSAGE); if(result == 1) { l1.setText(""); l1.setIcon(plain); return; } else System.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); you sure about

} if(ae.getSource()==zip||ae.getSource()==GZip||ae.getSource()==GZip1) //Zip button { if(!fname.equals("")){ xtn1="."+fname.charAt(fnmlen-4)+fname.charAt(fnmlen3)+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(fnmlen2)+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 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(); out = new GZIPOutputStream(new

} catch (IOException e) {} System.out.println("GZipping of "+outFilename+" is complete."); l1.setText(""); l1.setIcon(plain); } else JOptionPane.showMessageDialog(null,"This gzipped.","GZipper",JOptionPane.ERROR_MESSAGE); } else JOptionPane.showMessageDialog(null,"No 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(fnmlen3)+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 { File Selected To File is already

GZIPInputStream FileInputStream(fname)); FileOutputStream FileOutputStream(fileName.getAbsolutePath()+xtn);

in

new out

GZIPInputStream(new = new

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 UnGZipp","GZipper",JOptionPane.WARNING_MESSAGE); } if(ae.getSource()==About||ae.getSource()==About1) //About button { l1.setText("About"); l1.setIcon(about); JOptionPane.showMessageDialog(null,"<html> <u><b>GZipper</b></u></html>\n<html>Version l1.setText(""); l1.setIcon(plain); } : <i>1.0</i></html>\n<html>created by : <i>Joe Oommen</i></html>","GZipper",JOptionPane.INFORMATION_MESSAGE); File Selected To

} }

CHAPTER -5 OUTPUT

Output
Login

Main Frame

Open File

Source File

Select File

Zip File

Save File

Unreadable File Format

Unzip File

Open File

Save File

Original File

Help

Exit

CHAPTER -6 CONCLUSIONS

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.

CHAPTER 7 REFERENCE

REFERENCES: SOURCE:
THE FOLLOWING BOOKS ARE USED AS THE REFERENCES IN DEVELOPMENT OF THE SYSEM.

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

CHAPTER 8 Bibliography

BIBLIOGRAPHY:
THE FOLLOWING WEBSITES ARE USED AS THE REFERENCES IN DEVELOPMENT OF THE SYSTEM. Internet:

www.google.com www.source code.com

Anda mungkin juga menyukai