public String compressJavaScript(String script) throws IOException
{
StringReader stringReader = new StringReader(script);
JavaScriptCompressor yuiJavaScriptCompressor = new JavaScriptCompressor(stringReader, new YahooJSErrorReporter());
StringWriter stringWriter = new StringWriter();
yuiJavaScriptCompressor.compress(stringWriter, (Integer) compressorParameters.get(PARAMETER_LINEBREAK), (Boolean) compressorParameters.get(PARAMETER_MUNGE),
(Boolean) compressorParameters.get(PARAMETER_VERBOSE), (Boolean) compressorParameters.get(PARAMETER_PRESERVE_ALL_SEMICOLONS),
(Boolean) compressorParameters.get(PARAMETER_DISABLE_OPTIMIZATIONS));
String compressedScript = stringWriter.toString();
return compressedScript;
}