Well that was pretty much my question, I need to do something like this:
String scriptContent = \"print(\"Hello World\")\";
apache commons has a StringEscapeUtils http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/StringEscapeUtils.html