Class BuildInfo

java.lang.Object
edu.gvsu.kurmasz.warszawa.util.BuildInfo

public class BuildInfo
extends java.lang.Object
Build information about a package, including version number and build date. This class relies on the build info being stored in a properties file with a known name. (One way to do this is to have ant update the file.)
Author:
Zachary Kurmas
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  BuildInfo.InvalidBuildInfoFile
    Exception thrown when either the properties file won't parse, or the date in the properties file won't parse
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String DEFAULT_RESOURCE_NAME  
  • Method Summary

    Modifier and Type Method Description
    java.util.Date getBuildDate()  
    java.lang.String getVersion()  
    static BuildInfo make​(java.lang.Class<? extends java.lang.Object> c)
    Loads the default resource for the class' package and returns a BuildInfo object representing data stored in the resource.
    static BuildInfo make​(java.lang.String resource, java.lang.Class<? extends java.lang.Object> c)
    Loads the specified resource for the class' package and returns a BuildInfo object representing data stored in the resource.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • getBuildDate

      public java.util.Date getBuildDate()
    • getVersion

      public java.lang.String getVersion()
    • make

      public static BuildInfo make​(java.lang.String resource, java.lang.Class<? extends java.lang.Object> c)
      Loads the specified resource for the class' package and returns a BuildInfo object representing data stored in the resource. Obtained from Sun's Java Forum
      Parameters:
      resource - the resource containing the build date
      c - A class in the package containing the resource
      Returns:
      a BuildInfo object containing the information stored in the resource, or null if the resource can't be found.
    • make

      public static BuildInfo make​(java.lang.Class<? extends java.lang.Object> c)
      Loads the default resource for the class' package and returns a BuildInfo object representing data stored in the resource. Obtained from Sun's Java Forum
      Parameters:
      c - A class in the package containing the resource
      Returns:
      a BuildInfo object containing the information stored in the resource, or null if the resource can't be found.