@Consumes({"script/groovy"})
@Path("validate{name:.*}")
public Response validateScript(@PathParam("name") String name, InputStream script)
{
GroovyClassLoader groovyClassLoader = groovyPublisher.getGroovyClassLoader();
if (name == null || name.length() == 0)
{
name = groovyClassLoader.generateScriptName();
}
else if (name.startsWith("/"))
{
name = name.substring(1);
}
try
{
groovyClassLoader.parseClass(script, name);
return Response.status(Response.Status.OK).build();
}
catch (Exception e)
{
LOG.error(e.getMessage(), e);