Class MainAttributes


  • public final class MainAttributes
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.jar.Attributes attributes
      Manifest from jar
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String get​(java.lang.String name)
      Retrieve the value of attribute with the specified name, or null if not present
      java.lang.String get​(java.util.jar.Attributes.Name name)
      Retrieve the value of attribute with the specified name, or null if not present
      static MainAttributes of​(java.io.File jar)
      Create a MainAttributes instance for the supplied jar file
      static MainAttributes of​(java.net.URI uri)
      Create a MainAttributes instance for the supplied jar file
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • attributes

        protected final java.util.jar.Attributes attributes
        Manifest from jar
    • Method Detail

      • get

        public final java.lang.String get​(java.lang.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 java.lang.String get​(java.util.jar.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​(java.io.File jar)
        Create a MainAttributes instance for the supplied jar file
        Parameters:
        jar - jar file
        Returns:
        MainAttributes instance
      • of

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