java.lang.Object
org.eclipse.jetty.toolchain.test.JAR

public final class JAR extends Object
Basic functions for working with JAR files in test cases.
  • Constructor Details

    • JAR

      private JAR()
  • Method Details

    • unpack

      public static void unpack(File jarFile, File destDir) throws IOException
      Unpack JAR file into destination directory.
      Parameters:
      jarFile - the jar file to unpack
      destDir - the destination directory to unpack into
      Throws:
      IOException - if unable to unpack jar file.
    • unpack

      private static void unpack(JarFile jar, JarEntry entry, File destFile) throws IOException
      Throws:
      IOException
    • close

      public static void close(JarFile jar)
      Close a JAR file.
      Parameters:
      jar - the JarFile to close
    • create

      public static void create(File srcDir, File jarFile) throws IOException
      Create a JAR file out of the contents of a specific directory (recursively)
      Parameters:
      srcDir - the source directory
      jarFile - the destination jar file to create
      Throws:
      IOException - if unable to create the jar file, or read the source directory
    • packDir

      private static void packDir(File baseDir, File srcDir, JarOutputStream jarout) throws IOException
      Throws:
      IOException