B2D001/ 0000755 0000002 0000002 00000000000 13127752024 0011256 5 ustar 00bin bin 0000473 0000641 B2D001/dffedsvrc_config.xml 0000755 0000002 0000002 00000222330 13127751717 0015310 0 ustar 00bin bin 0000473 0000641
def cfg = new XmlParser().parse(properties.'server.config')
if ( "" == "@{file.optionSet}" ) {
cfg.Option.each { option ->
println option['@name']
if ( option['@name'] == "@{file.option}" ) {
properties.'server.value' = option.text()
}
}
} else {
cfg.SystemUsers.each { options ->
options.Option.each { option ->
println option['@name']
if ( option['@name'] == "@{file.option}" ) {
properties.'server.value' = option.text()
}
}
}
}
<!ENTITY cfg.license.primary.loc "${dffedsvrc.license}">${line.separator}
def fn = properties.'server.config'
def fis = new FileInputStream("${fn}")
def bom = new byte[4]
// default to UTF-8
properties.'dmv.file.enc' = "UTF-8"
try {
fis.read(bom)
//convert to hex strings each being a char
String hex0 = Integer.toHexString(bom[0] & 0xFF)
String hex1 = Integer.toHexString(bom[1] & 0xFF)
String hex2 = Integer.toHexString(bom[2] & 0xFF)
String hex3 = Integer.toHexString(bom[3] & 0xFF)
if (((hex0 == "ff") && (hex1 == "fe") &&
(hex2 == "00") && (hex3 == "00")) ||
((hex0 == "fe") && (hex1 == "ff") &&
(hex2 == "00") && (hex3 == "00")))
{
properties.'dmv.file.enc' = "UTF-32"
if(properties.verbose == "true") { println "found UTF-32 encoding"}
}
if( (hex0 == "ff" && hex1 == "fe") ||
(hex0 == "fe" && hex1 == "ff"))
{
properties.'dmv.file.enc' = "UTF-16"
if(properties.verbose == "true") { println "found UTF-16 encoding" }
}
if ((hex0 == "ef") &&
(hex1 == "bb") &&
(hex2 == "bf"))
{
properties.'dmv.file.enc' = "UTF-8"
if(properties.verbose == "true") { println "found UTF-8 encoding"}
}
if(properties.verbose == "true") { println "use encoding: ${properties.'dmv.file.enc'}"}
} catch(e) {
println " failed to read file: ${fn}"
} finally { fis.close() }
-->
<!ENTITY cfg.license.primary.loc "${dffedsvrc.license}">${line.separator}