B2F001/ 0000755 0000002 0000002 00000000000 13125250712 0011253 5 ustar 00bin bin 0000473 0000641 B2F001/posvrc_config.xml 0000755 0000002 0000002 00000060654 13125250712 0014654 0 ustar 00bin bin 0000473 0000641
base/auth_server_loc=iom://${iomsrv.metadatasrv.host}:${iomsrv.metadatasrv.port}
base/app_container_domain=DefaultAuth
base/primary_license_loc=${server.posvrc.license}
dmserver/name=${server.posvrc.servercomponent.name}
dmserver/secure/grp_admin=SASAdministrators
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() }
ons -->