com.infoengine.administration.packaging
Class PackageComparator

java.lang.Object
  extended bycom.infoengine.administration.packaging.PackageComparator

public class PackageComparator
extends Object


Field Summary
(package private)  File existingPackage
           
private static int MEM_MAP_SIZE
           
(package private)  File newPackage
           
(package private)  JarUtils utils
           
 
Constructor Summary
PackageComparator(File existingPackage, File newPackage)
          Constructs a new Package Comparator to compare to package archives.
 
Method Summary
 boolean compare()
          Performs the comparison.
private  boolean compareDirectories(File dir1, File dir2)
           
private  boolean compareFiles(File f1, File f2)
           
private  boolean compareJars(File jar1, File jar2)
           
private static void delTree(File dir)
           
private  File findByName(File[] files, File f)
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEM_MAP_SIZE

private static final int MEM_MAP_SIZE
See Also:
Constant Field Values

existingPackage

File existingPackage

newPackage

File newPackage

utils

JarUtils utils
Constructor Detail

PackageComparator

public PackageComparator(File existingPackage,
                         File newPackage)
Constructs a new Package Comparator to compare to package archives.

Parameters:
existingPackage - - An existing package *must* have either ptctar or ptcdar extension
newPackage - - A new package could be named anything (probably temporary file).
Method Detail

compare

public boolean compare()
                throws IOException
Performs the comparison.

Returns:
True if packages are equivalent.
Throws:
IOException - If an exception occurs while reading the jars.

compareJars

private boolean compareJars(File jar1,
                            File jar2)
                     throws IOException
Throws:
IOException

compareDirectories

private boolean compareDirectories(File dir1,
                                   File dir2)
                            throws IOException
Throws:
IOException

compareFiles

private boolean compareFiles(File f1,
                             File f2)
                      throws IOException
Throws:
IOException

findByName

private File findByName(File[] files,
                        File f)

delTree

private static void delTree(File dir)

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception