de.vxart.zipupdate
Class UpdateEngine

java.lang.Object
  extended by de.vxart.zipupdate.UpdateEngine

public class UpdateEngine
extends java.lang.Object

The work horse of the whole update system containing the diff and patch functionality as well as hooks to register listeners.

Author:
Philipp Reichart, philipp.reichart@vxart.de

Constructor Summary
UpdateEngine()
          Constructs a new UpdateEngine instance.
 
Method Summary
 void addProgressListener(ProgressListener listener)
          Registers a ProgressListener with this instance of an UpdateEngine.
static void main(java.lang.String[] args)
          Provides a basic stand-alone way to update archives.
 void removeProgressListener(ProgressListener listener)
          Unregisters a ProgressListener with this instance of an UpdateEngine.
 int update(java.util.zip.ZipFile[] archives, UpdateLocation[] locations, java.lang.String[] messages)
          Updates multiple ZIP files from the given URLs.
 boolean update(java.util.zip.ZipFile archive, UpdateLocation location)
          Updates a ZIP file from a given URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateEngine

public UpdateEngine()
Constructs a new UpdateEngine instance.

Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Provides a basic stand-alone way to update archives.

Parameters:
args -
Throws:
java.lang.Exception

update

public int update(java.util.zip.ZipFile[] archives,
                  UpdateLocation[] locations,
                  java.lang.String[] messages)
           throws java.io.IOException
Updates multiple ZIP files from the given URLs. Displays a message for each ZIP file as it is being updated; if there are not enough messages for all ZIP files or the messages are NULL, the file name will be used.

Parameters:
archives - the ZIP files to update
locations - the locations where to look for the up-to-date ZIP files
messages - the messages to display for each ZIP file
Returns:
the number of ZIP files that have actually been updated
Throws:
java.io.IOException

update

public boolean update(java.util.zip.ZipFile archive,
                      UpdateLocation location)
               throws java.io.IOException
Updates a ZIP file from a given URL.

Parameters:
archive - the ZIP file to update
location - the location where to look for the up-to-date ZIP file
Returns:
true if any updates have actually been performed, false otherwise
Throws:
java.io.IOException

addProgressListener

public void addProgressListener(ProgressListener listener)
Registers a ProgressListener with this instance of an UpdateEngine.


removeProgressListener

public void removeProgressListener(ProgressListener listener)
Unregisters a ProgressListener with this instance of an UpdateEngine.