Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 23 lines (19 sloc) 1.165 kB
1a59247 init
bill shelton authored
1 <cfcomponent hint="utility for reading version information" output="false">
2
3 <cffunction name="getVersionInfo" output="false" access="public" returntype="struct" hint="returns a struct containing VersionNumber and VersionDate keys">
4 <cfset var versionFilePath = getVersionFilePath()>
5 <cfset var props = createObject("java","java.util.Properties")>
6 <cfset var fis = createObject("java","java.io.FileInputStream")>
7 <cfset var result = StructNew()>
8 <cfset fis.init(versionFilePath)>
9 <cfset props.load(fis)>
10 <cfset result.VersionDate = props.getProperty("build.date")>
11 <cfset result.VersionNumber = props.getProperty("build.major") & "." & props.getProperty("build.minor") & "." & props.getProperty("build.buildnum")>
12 <cfreturn result>
13
14 </cffunction>
15
16 <cffunction name="getVersionFilePath" access="private">
17 <!--- can't use expandpath because it doesn't work correctly when accessed remotely (i.e. from plugin) --->
18 <cfset var propDir = getDirectoryFromPath(getCurrentTemplatePath())>
19 <cfset propDir = reverse(listRest(reverse(propDir),"\/")) & "/buildprops/">
20 <cfreturn propDir & "version.properties">
21 </cffunction>
22
23 </cfcomponent>
Something went wrong with that request. Please try again.