char[] currentArray = current.trim().toCharArray();
char[] newpassArray = newpass.trim().toCharArray();
GeoServerSecurityManager m = getManager();
try {
m.saveMasterPasswordConfig(m.loadMasterPasswordConfig(), currentArray,
newpassArray, newpassArray);
} catch (Exception e) {
throw new RestletException("Cannot change master password",
Status.CLIENT_ERROR_UNPROCESSABLE_ENTITY,e);
} finally {
m.disposePassword(currentArray);
m.disposePassword(newpassArray);
}
}