Class JarUtils


  • public final class JarUtils
    extends Object
    Jar utilites.
    • Method Detail

      • readJar

        public static byte[] readJar​(String path)
        Read Jar file into byte array
        Parameters:
        path - Path of the Jar file
        Returns:
        Byte array representation of the Jar file
      • writeJar

        public static void writeJar​(String jarPath,
                                    byte[] jarBytes)
        Write jar into disk from bytes
        Parameters:
        jarPath - Path of jar
        jarBytes - Bytes of jar
      • getAllClassesInJar

        public static List<String> getAllClassesInJar​(String jarPath)
                                               throws Exception
        Get all class names in JAR
        Parameters:
        jarPath - Path to JAR
        Returns:
        List of class names in JAR
        Throws:
        Exception - if some exception occurs.