com.android.sdklib.build
Class JarListSanitizer

java.lang.Object
  extended by com.android.sdklib.build.JarListSanitizer

public class JarListSanitizer
extends java.lang.Object

A Class to handle a list of jar files, finding and removing duplicates. Right now duplicates are based on: - same filename - same length - same content: using sha1 comparison. The length/sha1 are kept in a cache and only updated if the library is changed.


Nested Class Summary
static class JarListSanitizer.DifferentLibException
          Exception used to indicate the sanitized list of jar dependency cannot be computed due to inconsistency in duplicate jar files.
static class JarListSanitizer.Sha1Exception
          Exception to indicate a failure to check a jar file's content.
 
Constructor Summary
JarListSanitizer(java.io.File out)
          Creates a sanitizer.
JarListSanitizer(java.io.File out, java.io.PrintStream outStream)
           
 
Method Summary
 java.util.List<java.io.File> sanitize(java.util.Collection<java.io.File> files)
          Sanitize a given list of files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarListSanitizer

public JarListSanitizer(java.io.File out)
Creates a sanitizer.

Parameters:
out - the project output where the cache is to be stored.

JarListSanitizer

public JarListSanitizer(java.io.File out,
                        java.io.PrintStream outStream)
Method Detail

sanitize

public java.util.List<java.io.File> sanitize(java.util.Collection<java.io.File> files)
                                      throws JarListSanitizer.DifferentLibException,
                                             JarListSanitizer.Sha1Exception
Sanitize a given list of files

Parameters:
files - the list to sanitize
Returns:
a new list containing no duplicates.
Throws:
JarListSanitizer.DifferentLibException
JarListSanitizer.Sha1Exception