question: public void writeJarFromContent ( final String className , final String content , final OutputStream outStream ) throws IOException { JarOutputStream jarOutputStream = new JarOutputStream ( outStream ) ; String formattedName = className ; if ( ! formattedName . endsWith ( ".class" ) ) { formattedName = formattedName . concat ( ".class" ) ; } if ( className . contains ( "/" ) ) { JarEntry entry = new JarEntry ( className . substring ( 0 , className . lastIndexOf ( '/' ) ) ) ; entry . setTime ( System . currentTimeMillis ( ) ) ; jarOutputStream . putNextEntry ( entry ) ; } JarEntry entry = new JarEntry ( formattedName ) ; entry . setTime ( System . currentTimeMillis ( ) ) ; jarOutputStream . putNextEntry ( entry ) ; jarOutputStream . write ( compileClass ( className , content ) ) ; jarOutputStream . closeEntry ( ) ; jarOutputStream . close ( ) ; }
target:  Write a JAR with a class of the given name with the provided content. The className may have a package separated by /. For example: my/package/myclass