Class JarUtils

java.lang.Object
org.fedoraproject.xmvn.tools.install.JarUtils

public final class JarUtils extends Object
Author:
Mikolaj Izdebski
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Heuristically try to determine whether given JAR (or WAR, EAR, ...) file contains native (architecture-dependent) code.
    static void
    injectManifest(Path targetJar, org.fedoraproject.xmvn.artifact.Artifact artifact)
    Inject artifact coordinates into manifest of specified JAR (or WAR, EAR, ...) file.
    static boolean
    Heuristically try to determine whether given JAR (or WAR, EAR, ...) file is using native (architecture-dependent) code.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • containsNativeCode

      public static boolean containsNativeCode(Path jarPath)
      Heuristically try to determine whether given JAR (or WAR, EAR, ...) file contains native (architecture-dependent) code.

      Currently this code only checks only for ELF binaries, but that behavior can change in future.

      Returns:
      true if native code was found inside given JAR
    • usesNativeCode

      public static boolean usesNativeCode(Path jarPath)
      Heuristically try to determine whether given JAR (or WAR, EAR, ...) file is using native (architecture-dependent) code.

      Currently this code only checks if any class file declares Java native methods, but that behavior can change in future.

      Returns:
      true given JAR as found inside to use native code
    • injectManifest

      public static void injectManifest(Path targetJar, org.fedoraproject.xmvn.artifact.Artifact artifact)
      Inject artifact coordinates into manifest of specified JAR (or WAR, EAR, ...) file. The file is modified in-place.
      Parameters:
      targetJar -
      artifact -