1 17 18 19 20 package org.apache.fop; 21 22 27 public final class Version { 28 29 private Version() { } 30 31 35 public static String getVersion() { 36 String version = null; 37 Package jarinfo = Version.class.getPackage(); 38 if (jarinfo != null) { 39 version = jarinfo.getImplementationVersion(); 40 } 41 if (version == null) { 42 String headURL 44 = "$HeadURL: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/src/java/org/apache/fop/Version.java $"; 45 version = headURL; 46 final String pathPrefix = "/xmlgraphics/fop/"; 47 int pos = version.indexOf(pathPrefix); 48 if (pos >= 0) { 49 version = version.substring(pos + pathPrefix.length() - 1, version.length() - 2); 50 pos = version.indexOf("/src/"); 51 version = version.substring(1, pos); 52 version = " " + version; 53 } else { 54 version = ""; 55 } 56 version = "SVN" + version; 57 } 58 return version; 59 } 60 61 } 62 | Popular Tags |