1 |
2079
|
jones
|
/**
|
2 |
|
|
* '$RCSfile$'
|
3 |
|
|
* Copyright: 2004 Regents of the University of California and the
|
4 |
|
|
* National Center for Ecological Analysis and Synthesis
|
5 |
|
|
*
|
6 |
|
|
* '$Author$'
|
7 |
|
|
* '$Date$'
|
8 |
|
|
* '$Revision$'
|
9 |
|
|
*
|
10 |
|
|
* This program is free software; you can redistribute it and/or modify
|
11 |
|
|
* it under the terms of the GNU General Public License as published by
|
12 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
13 |
|
|
* (at your option) any later version.
|
14 |
|
|
*
|
15 |
|
|
* This program is distributed in the hope that it will be useful,
|
16 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
* GNU General Public License for more details.
|
19 |
|
|
*
|
20 |
|
|
* You should have received a copy of the GNU General Public License
|
21 |
|
|
* along with this program; if not, write to the Free Software
|
22 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23 |
|
|
*/
|
24 |
|
|
package edu.ucsb.nceas.metacat;
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
/**
|
28 |
|
|
* @author jones
|
29 |
|
|
*
|
30 |
|
|
* Version represents the current version information for this Metacat instance.
|
31 |
|
|
*/
|
32 |
|
|
public class Version
|
33 |
|
|
{
|
34 |
|
|
/**
|
35 |
|
|
* Get the current version string for this metacat instance.
|
36 |
|
|
* It is currently stored in the metacat.properties file.
|
37 |
|
|
*
|
38 |
|
|
* @return a string indicating the version of Metacat running
|
39 |
|
|
*/
|
40 |
|
|
public static String getVersion()
|
41 |
|
|
{
|
42 |
|
|
String version = MetaCatUtil.getOption("version");
|
43 |
|
|
return version;
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
/**
|
47 |
|
|
* Get the version number in an XML document.
|
48 |
|
|
*
|
49 |
|
|
* @return the version wrapped in an XML document
|
50 |
|
|
*/
|
51 |
|
|
public static String getVersionAsXml()
|
52 |
|
|
{
|
53 |
|
|
StringBuffer sb = new StringBuffer();
|
54 |
|
|
sb.append("<?xml version=\"1.0\"?>");
|
55 |
|
|
sb.append("<version>");
|
56 |
|
|
sb.append(Version.getVersion());
|
57 |
|
|
sb.append("</version>");
|
58 |
|
|
return sb.toString();
|
59 |
|
|
}
|
60 |
|
|
}
|