Package tech.mgl.utils
Class MGL_WebResourceCompressor
java.lang.Object
tech.mgl.utils.MGL_WebResourceCompressor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcompressCss(String css) 压缩CSS代码static StringcompressHtml(String html) 压缩HTML代码static StringcompressHtml(String html, List<String> preservePatterns) static voidcompressHtmlFile(String htmlPath) static voidcompressHtmlFile(String htmlPath, List<String> preservePatterns) static StringcompressJS(String source) 压缩文件基础方法static StringcompressJSForInHTML(String htmlStr) static StringsetUrlForChn(String url) 对含有中文的字符串进行Unicode编码 龥 Unicode表中的汉字的头和尾
-
Constructor Details
-
MGL_WebResourceCompressor
public MGL_WebResourceCompressor()
-
-
Method Details
-
compressJSForInHTML
- Throws:
Exception
-
compressHtml
压缩HTML代码- Parameters:
html- 原始HTML代码- Returns:
- 压缩后的HTML代码
- Throws:
Exception
-
compressHtmlFile
- Throws:
Exception
-
compressHtmlFile
public static void compressHtmlFile(String htmlPath, List<String> preservePatterns) throws Exception - Throws:
Exception
-
compressHtml
- Throws:
Exception
-
setUrlForChn
对含有中文的字符串进行Unicode编码 龥 Unicode表中的汉字的头和尾- Throws:
Exception
-
compressCss
压缩CSS代码- Parameters:
css- 原始CSS代码- Returns:
- 压缩后的CSS代码
- Throws:
IOException- 如果读取/写入过程中发生错误
-
compressJS
压缩文件基础方法- Parameters:
source-- Returns:
- Throws:
Exception
-