org.jarpatch
Class JarPatch

java.lang.Object
  extended by org.jarpatch.JarPatch

public class JarPatch
extends java.lang.Object

build a patch zip that contains the difference between a newJar from an oldJar.

The patch will contains all new file introduced on the newJar, and all file that have been modified from the oldJar. Changed file is determined from computed MD5 hash key.

Version:
$Revision$
Author:
Norbert Barbosa

Field Summary
static java.lang.String DELLOG_NAME
           
static java.util.regex.Pattern[] EMPTY_PATTERN
           
 
Constructor Summary
JarPatch()
           
 
Method Summary
 boolean buildPatch(java.io.File newJar, java.io.File oldJar, java.util.regex.Pattern[] excludes, java.io.File zipPatchFile, boolean logDeletedFiles)
          build the resulting patch.
static java.util.regex.Pattern[] tokenizePatterns(java.lang.String patterns)
          helper method to build an Pattern array from a list of comma separate string pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELLOG_NAME

public static final java.lang.String DELLOG_NAME
See Also:
Constant Field Values

EMPTY_PATTERN

public static final java.util.regex.Pattern[] EMPTY_PATTERN
Constructor Detail

JarPatch

public JarPatch()
Method Detail

buildPatch

public boolean buildPatch(java.io.File newJar,
                          java.io.File oldJar,
                          java.util.regex.Pattern[] excludes,
                          java.io.File zipPatchFile,
                          boolean logDeletedFiles)
                   throws java.io.IOException
build the resulting patch.

Parameters:
newJar - - the new jar, use to compute difference
oldJar - - the old jar, use to compute difference
excludes - - an optional (can be null) regexp for excluding ressource
zipPatchFile - - the result zip file, that contains the difference between newJar and oldJar
logDeletedFiles - - if true then add a file jarpatch_deleted.log on the zipPatchFile, that contains the list of files that are found in oldJar but not in newJar (one line by file)
Returns:
true if a patch can be build, false if no difference have been found
Throws:
java.io.IOException - - if IO error occur

tokenizePatterns

public static java.util.regex.Pattern[] tokenizePatterns(java.lang.String patterns)
                                                  throws java.util.regex.PatternSyntaxException
helper method to build an Pattern array from a list of comma separate string pattern. if no pattern, return EMPTY_PATTERNS.

Throws:
java.util.regex.PatternSyntaxException


Copyright © 2004 Norbert Barbosa?t - norbert.barbosa@laposte.com - All rights reserved.