Class JarLocation


  • public class JarLocation
    extends Object
    A class which encapsulates the location on the local filesystem of the JAR in which the current code is executing.
    • Constructor Detail

      • JarLocation

        public JarLocation​(Class<?> klass)
        Constructs a new JarLocation object which gets access to the code source with the provided parameter.
        Parameters:
        klass - the class to access the code source from
    • Method Detail

      • getVersion

        public Optional<String> getVersion()
        Returns the version of the current jar holding the provided klass.
        Returns:
        the version representation