From 3035d3a7c871b99524ea346039c68a145e5d960c Mon Sep 17 00:00:00 2001 From: Mark Diggory Date: Sun, 7 Feb 2010 00:35:14 +0000 Subject: [PATCH] Handle Exeptions to eliminate issues when testing / debugging in IDE's and allow application to run with a default fversion if pom cannot be determined., git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4743 9c30dcfa-912a-0410-8fc2-9e0234be79fd --- .../src/main/java/org/dspace/app/util/Util.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/util/Util.java b/dspace-api/src/main/java/org/dspace/app/util/Util.java index f5934e3bbd..d416a0fd87 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/Util.java +++ b/dspace-api/src/main/java/org/dspace/app/util/Util.java @@ -346,14 +346,23 @@ public class Util { * @return string containing version, e.g. "1.5.2"; ends in "-SNAPSHOT" for development versions. */ public static String getSourceVersion() - throws IOException { if (sourceVersion == null) { - InputStream cis = Util.class.getResourceAsStream - ("/META-INF/maven/org.dspace/dspace-api/pom.properties"); Properties constants = new Properties(); - constants.load(cis); + + try + { + InputStream cis = Util.class.getResourceAsStream + ("/META-INF/maven/org.dspace/dspace-api/pom.properties"); + + constants.load(cis); + } + catch(Exception e) + { + log.error(e.getMessage(),e); + } + sourceVersion = constants.getProperty("version", "none"); } return sourceVersion;