org.rhq.test
Class DuplicatePackagesDetector

java.lang.Object
  extended by org.rhq.test.DuplicatePackagesDetector

public class DuplicatePackagesDetector
extends Object

This will walk a set of jar files and directories and print out packages that are found in more than one jar file.

Author:
John Mazzitelli

Nested Class Summary
static class DuplicatePackagesDetector.Visitor
           
 
Constructor Summary
DuplicatePackagesDetector()
           
 
Method Summary
static void main(String[] args)
          Each argument is the name of a .jar file or a directory that will be walked looking for jar files.
static void processDirectory(File dir)
           
static void processFile(File file)
           
static void walkZipFile(File zipFile, DuplicatePackagesDetector.Visitor visitor)
          Walks the entries of a zip file, allowing a listener to "visit" each node and perform tasks on the zip entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuplicatePackagesDetector

public DuplicatePackagesDetector()
Method Detail

main

public static void main(String[] args)
Each argument is the name of a .jar file or a directory that will be walked looking for jar files.


processDirectory

public static void processDirectory(File dir)

processFile

public static void processFile(File file)

walkZipFile

public static void walkZipFile(File zipFile,
                               DuplicatePackagesDetector.Visitor visitor)
                        throws Exception
Walks the entries of a zip file, allowing a listener to "visit" each node and perform tasks on the zip entry.

Parameters:
zipFile - the zip file to walk
visitor - the object that will be notified for each entry in the zip file
Throws:
Exception - if any errors occur during the reading or visiting


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.