public byte[] createJarFromFileContent(final String fileName, final String content)
      throws IOException {
    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    JarOutputStream jarOutputStream = new JarOutputStream(byteArrayOutputStream);

    JarEntry entry = new JarEntry(fileName);
    entry.setTime(System.currentTimeMillis());
    jarOutputStream.putNextEntry(entry);
    jarOutputStream.write(content.getBytes());
    jarOutputStream.closeEntry();

    jarOutputStream.close();
    return byteArrayOutputStream.toByteArray();
  }
Create a JAR using the given file contents and with the given file name.

@param fileName Name of the file to create
@param content Content of the created file
@return The JAR file content
@throws IOException If there is a problem creating the output stream for the JAR file.
geode-junit/src/main/java/org/apache/geode/test/compiler/ClassBuilder.java