RealChat Software

5.5. Manipulating JAR Files


Overview

RealChat Client consists of a large number of compiled Java™ .class files, image files, and other resources. Loading these files one by one is inefficient. That's why most of the commonly needed files are packaged as a single compressed JAR file, the RealChat.jar file. This way the browser makes a single request to the web server and downloads the whole thing at once, which means much faster loading.


JAR Files

JAR files are basically .zip files, which means that they can be manipulated with any ZIP utility, such as WinZip. Give it a try: open RealChat.jar with a ZIP utility and continue to the next section.


RealChat Client Resources

By default, RealChat.jar file contains a directory structure like this:

The folders which you may be interested in are /images and /lang. You should not alter the others.

When the RealChat Client program needs a resource, it first checks the JAR file and then the containing directory. For example, when it needs the English language file, no additional requests will be made to the web server as the RealChat_en.class is present in the archive; if the program needed an additional language pack, such as RealChat_fr, the program will send a request to http://yoursite.com/chat/lang/RealChat_fr.class.

If your site main language is other than English, you might want to put the language file in the JAR for faster loading.

The same is true for images: put your logo image in the JAR file, instead of the main /images directory.

Currently, sound files can't be loaded from a JAR archive.

A Quick Example

Let's say you need to customize avatar icons for your chat system. Here is how to do this:

  1. Open RealChat.jar with a ZIP utility and extract all the files to a directory on your local hard drive.
  2. Go to that directory and enter the /images directory. Open the avatars.gif file with your favorite graphics editor.
  3. Edit the file and save it. See Images Customization section for details.
  4. Zip all the files back and name the archive RealChat.jar.
  5. Put the new archive on your site and test it.

    good luck :)



Contents | Parent Topic | Previous Topic | Next Topic