Interface ResourceMinificationService

All Known Implementing Classes:
ResourceMinificationServiceImpl

public interface ResourceMinificationService
Service responsible for interacting with YUI-compressor or Google Closure Compiler to minify JS/CSS resources.

Property to enable minification: minify.enabled - whether or not to actually perform minification

Author:
Andre Azzolini (apazzolini)
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether or not the system is allowed to minify bundled resources.
    byte[]
    minify(String filename, byte[] bytes)
    Given the source byte[], will return a byte[] that represents the minified version of the byte[]
    org.springframework.core.io.Resource
    minify(org.springframework.core.io.Resource originalResource)
    Delegates to minify(Resource, String) where the filename argument is originalResource.getFilename().
    org.springframework.core.io.Resource
    minify(org.springframework.core.io.Resource originalResource, String filename)
    Given a Resource, will return a resource that represents the minified version.
  • Method Details

    • minify

      byte[] minify(String filename, byte[] bytes)
      Given the source byte[], will return a byte[] that represents the minified version of the byte[]
      Parameters:
      filename -
      bytes -
      Returns:
      the minified bytes
    • getEnabled

      boolean getEnabled()
      Indicates whether or not the system is allowed to minify bundled resources.
      Returns:
      the value of the system property "minify.enabled"
    • minify

      org.springframework.core.io.Resource minify(org.springframework.core.io.Resource originalResource)
      Delegates to minify(Resource, String) where the filename argument is originalResource.getFilename().
      Parameters:
      originalResource -
      Returns:
    • minify

      org.springframework.core.io.Resource minify(org.springframework.core.io.Resource originalResource, String filename)
      Given a Resource, will return a resource that represents the minified version.
      Parameters:
      orginalResource -
      the - name of resource
      Returns:
      The minified resource