Class Minify

java.lang.Object
io.sf.carte.doc.style.css.util.Minify

public class Minify extends Object
Minify a CSS style sheet.
  • Constructor Details

    • Minify

      public Minify()
  • Method Details

    • main

      public static void main(String[] args) throws URISyntaxException, IOException
      Prints to standard output a minification of the CSS style sheet located at the supplied URI.

      If the given sheet contains error(s) and therefore cannot be reliably minified, the original source sheet is printed.

      Parameters:
      args - the URI to a style sheet.
      Throws:
      URISyntaxException - if the URI has wrong syntax.
      IllegalArgumentException - if the URI is otherwise incorrect.
      IOException - if an I/O error happened.
    • minifyCSS

      public static String minifyCSS(String css)
      Minifies a CSS style sheet.
      Parameters:
      css - the serialized style sheet.
      Returns:
      the minified serialization, or the original one if an error was detected.
    • minifyCSS

      public static String minifyCSS(Path cssPath) throws IOException
      Minifies a CSS style sheet.
      Parameters:
      cssPath - the path to style sheet.
      Returns:
      the minified serialization, or the original file if an error was found.
      Throws:
      IOException