Class MainAttributes

java.lang.Object
org.spongepowered.asm.launch.platform.MainAttributes

public final class MainAttributes extends Object
"Main" attribute cache for a URI container, mainly to avoid constantly opening jar files just to read odd values out of the manifest.
  • Field Details

    • attributes

      protected final Attributes attributes
      Manifest from jar
  • Method Details

    • get

      public final String get(String name)
      Retrieve the value of attribute with the specified name, or null if not present
      Parameters:
      name - attribute name
      Returns:
      attribute value or null if not present
    • get

      public final String get(Attributes.Name name)
      Retrieve the value of attribute with the specified name, or null if not present
      Parameters:
      name - attribute name
      Returns:
      attribute value or null if not present
    • of

      public static MainAttributes of(File jar)
      Create a MainAttributes instance for the supplied jar file
      Parameters:
      jar - jar file
      Returns:
      MainAttributes instance
    • of

      public static MainAttributes of(URI uri)
      Create a MainAttributes instance for the supplied jar file
      Parameters:
      uri - jar file location
      Returns:
      MainAttributes instance