return locale;
}
});
// quick check to see if we (seem to) have enough permissions to run. (see #719)
JVM jvm;
try {
jvm = new JVM();
new URLClassLoader(new URL[0],getClass().getClassLoader());
} catch(SecurityException e) {
controller.install(new InsufficientPermissionDetected(e));
return;
}
try {// remove Sun PKCS11 provider if present. See http://wiki.hudson-ci.org/display/HUDSON/Solaris+Issue+6276483
Security.removeProvider("SunPKCS11-Solaris");
} catch (SecurityException e) {
// ignore this error.
}
installLogger();
File dir = getHomeDir(event);
try {
dir = dir.getCanonicalFile();
}
catch (IOException e) {
dir = dir.getAbsoluteFile();
}
final File home = dir;
home.mkdirs();
LOGGER.info("Home directory: " + home);
// check that home exists (as mkdirs could have failed silently), otherwise throw a meaningful error
if (! home.exists()) {
controller.install(new NoHomeDir(home));
return;
}
// make sure that we are using XStream in the "enhanced" (JVM-specific) mode
if(jvm.bestReflectionProvider().getClass()==PureJavaReflectionProvider.class) {
// nope
controller.install(new IncompatibleVMDetected());
return;
}