def SplitJar(input_jar, output_directory, maximum_size=sys.maxint, include_predicate=(lambda name: True)):
 if (not input_jar.lower().endswith('.jar')):
  raise ValueError(('Does not end with .jar: %s' % input_jar))
 base_name = os.path.splitext(os.path.basename(input_jar))[0]
 with _Maker(output_directory, base_name, maximum_size) as maker:
  for (name, contents) in JarContents(input_jar):
   if ((name != 'META-INF/MANIFEST.MF') and (name != 'INDEX.LIST') and include_predicate(name)):
    size = len(contents)
    if (size > maximum_size):
     raise JarWriteError(('Entry %s in %s has size %d which is bigger than the maximum jar size %d' % (name, input_jar, size, maximum_size)))
    maker.WriteStr(name, contents)

def SplitJar ( input_jar , output_directory , maximum_size = sys . maxint , include_predicate = ( lambda name : True ) ) : if ( not input_jar . lower ( ) . endswith ( '.jar' ) ) : raise ValueError ( ( 'Does not end with .jar: %s' % input_jar ) ) base_name = os . path . splitext ( os . path . basename ( input_jar ) ) [ 0 ] with _Maker ( output_directory , base_name , maximum_size ) as maker : for ( name , contents ) in JarContents ( input_jar ) : if ( ( name != 'META-INF/MANIFEST.MF' ) and ( name != 'INDEX.LIST' ) and include_predicate ( name ) ) : size = len ( contents ) if ( size > maximum_size ) : raise JarWriteError ( ( 'Entry %s in %s has size %d which is bigger than the maximum jar size %d' % ( name , input_jar , size , maximum_size ) ) ) maker . WriteStr ( name , contents )
copies an input jar into a directory .