Technical

General description

JBackupWithZip is written entirely in Java 1.4 / Swing.

The graphical selection of folders and files uses the Swing JTree class.

Save-restore of the selection uses an XML file.

Task progression shown during zipping is allowed with the uses a independent thread for the zip task and with listener mechanism of the process running.

Visitor pattern

The class modeling uses intensively the visitor pattern (see Bruce Eckel's Thinking in Patterns book).

The tree nodes are the folders and files. They are visited for :

  • building the zip backup
  • estimating the amount of files and bytes
  • calculate the information of the processed folders and files during zip processing
  • building the DOM for the XML save of the selection

Process control and view

JBackupWithZip was an opportunity to build base classes in java to control and view a process while it is running.

The process is controled : start, cancel...

The process is viewed : follow the progression and what it is doing at any moment.
This include :

  • viewing the current file being zipped
  • calculating several items such as volume, number of files processed...
  • pre-calculate an estimation of volume and numbers of folders and files to process, and compare the data processed to the total amount to be done... and show the progression
  • run the process in a separate thread than the thread that do the control and view, to have them working "in the same time".

All these classes have been built with base classes that are general classes for any process to control and view.

The specific classes for the zipping process in JBackupWithZip have been inherited from the library class.

Then, you can reuse these general classes if they fit to your needs. See the last screenshots, called "Running the zip task : details about estimation and cancel"