public class JsPacker extends AbstractFilePacker
channel
Constructor and Description |
---|
JsPacker() |
Modifier and Type | Method and Description |
---|---|
static java.util.Set<java.lang.String> |
getJSFilesInPack(java.util.Collection<java.lang.String> jsFiles,
java.lang.String browserName)
Returns the set of the URLs created with the JS packer, respecting the constraints of the browser.
|
protected org.apache.log4j.Logger |
getLogger()
Returns the logger to be used for log messages.
|
static void |
minifyJS(boolean force)
Create a minified version of all JS found in JCMS.
|
protected boolean |
perFileMinificationEnabled()
Check if minification should be performed on each file as opposed to the whole pack.
|
protected java.lang.String |
processFileContent(java.lang.String relativeFilePath,
java.io.File file,
java.lang.String fileContent)
Process Javascript files' content
|
protected java.lang.String |
processPackContent(java.lang.String packContent)
Process Javascript pack's content
|
getFilePack, getFilesInPack, getMinifiedFile, minifyFile
public JsPacker() throws java.io.IOException
java.io.IOException
protected java.lang.String processFileContent(java.lang.String relativeFilePath, java.io.File file, java.lang.String fileContent)
processFileContent
in class AbstractFilePacker
relativeFilePath
- the relative path of the file being processedfile
- the file being processedfileContent
- the fileContent as read by the AbstractFilePackerprotected java.lang.String processPackContent(java.lang.String packContent)
processPackContent
in class AbstractFilePacker
packContent
- the whole pack content as computed by the AbstractFilePackerprotected boolean perFileMinificationEnabled()
AbstractFilePacker
perFileMinificationEnabled
in class AbstractFilePacker
protected org.apache.log4j.Logger getLogger()
AbstractFilePacker
getLogger
in class AbstractFilePacker
Logger
of this packer, must not return null.public static void minifyJS(boolean force)
This method only process css file if minification is enabled through property
"channel.js-packer.compressor.enabled"
.
Only files contained in directories css, plugins and js are processed
force
- set to true to force generation of minified file even if an up to date apparently existspublic static java.util.Set<java.lang.String> getJSFilesInPack(java.util.Collection<java.lang.String> jsFiles, java.lang.String browserName)
jsFiles
- collection of JavaScript files to packbrowserName
- name of the browser used to find the properties 'channel.packer.xxx' defining the limit values. If null
, use 'IE'
because it's the most constraining.Copyright © 2001-2017 Jalios SA. All Rights Reserved.