Class MCRSassCompilerManager

java.lang.Object
org.mycore.sass.MCRSassCompilerManager

public class MCRSassCompilerManager extends Object
Compiles .scss to .css or .min.css using different sources (Importers)
Author:
Sebastian Hofmann (mcrshofm)
See Also:
  • Constructor Details

    • MCRSassCompilerManager

      public MCRSassCompilerManager()
  • Method Details

    • getInstance

      public static MCRSassCompilerManager getInstance()
    • getCSSFile

      public Optional<String> getCSSFile(String file, List<io.bit3.jsass.importer.Importer> importer) throws io.bit3.jsass.CompilationException, IOException
      Gets the compiled(&compressed) CSS
      Parameters:
      file - the path to a .scss file. File should end with .css or .min.css (The compiler will look for the .scss file, then compiles and decides to minify or not).
      importer - a additional list of importers
      Returns:
      Optional with the compiled css as string. Empty optional if the fileName is not valid.
      Throws:
      io.bit3.jsass.CompilationException - if Compiler.compile(FileContext) throws
      IOException
    • getLastCompiled

      public Optional<Date> getLastCompiled(String name)
      Parameters:
      name - the name of file
      Returns:
      the time when the specific file was compiled last time.
    • getLastMD5

      public Optional<String> getLastMD5(String name)
      Parameters:
      name - the name of file
      Returns:
      the md5 hash of the last compiled specific file.
    • isDeveloperMode

      public boolean isDeveloperMode()