Class JarLocation

java.lang.Object
io.dropwizard.util.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 Details

    • 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 Details

    • getVersion

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

      public String toString()
      Overrides:
      toString in class Object