}
public static void checkValidName(String name) throws ScriptException{
if (name== null||name.trim().length()==0){
throw new InvalidScriptException("Script must have non empty name");
}
if (!VALID_NAME_PATTERN.matcher(name).matches()){
throw new InvalidScriptException("Script names must be composed of letters numbers and underscores, and cannot start with numbers. Script must have at least one namespace part. Valid example: mynamespace.myscript");
}
if (isInternalName(name)){
throw new InvalidScriptException("User scripts cannot belong to 'baasbox' namespace");
}
}