MCPcopy Index your code
hub / github.com/ari4java/ari4java / getBuildVersion

Method getBuildVersion

src/main/java/ch/loway/oss/ari4java/ARI.java:518–551  ·  view source on GitHub ↗

Gets the package information an @return String

()

Source from the content-addressed store, hash-verified

516 * @return String
517 */
518 public String getBuildVersion() {
519 String buildVersion = "x";
520 try {
521 if (getClass().getPackage().getImplementationVersion() != null) {
522 buildVersion = getClass().getPackage().getImplementationVersion();
523 }
524 } catch (Exception e) {
525 // oh well
526 }
527 InputStream stream = null;
528 try {
529 stream = getClass().getClassLoader().getResourceAsStream("build.properties");
530 if (stream != null) {
531 Properties p = new Properties();
532 p.load(stream);
533 final String prop = "BUILD_NUMBER";
534 if (p.containsKey(prop) && p.getProperty(prop) != null &&
535 !"x".equalsIgnoreCase(p.getProperty(prop))) {
536 buildVersion += " (Build: " + p.getProperty(prop) + ")";
537 }
538 }
539 } catch (IOException e) {
540 // oh well
541 } finally {
542 if (stream != null) {
543 try {
544 stream.close();
545 } catch (IOException e) {
546 // oh well
547 }
548 }
549 }
550 return buildVersion;
551 }
552
553 /**
554 * This interface is used to go from an interface to its concrete implementation.

Callers 1

testBuildVersionMethod · 0.80

Calls 2

getPackageMethod · 0.80
closeMethod · 0.80

Tested by 1

testBuildVersionMethod · 0.64