| 1 17 package net.sf.packtag.implementation; 18 19 import java.io.InputStream ; 20 21 import net.sf.packtag.strategy.AbstractPackStrategy; 22 import net.sf.packtag.strategy.PackException; 23 24 25 26 32 public class IBloomCssPackStrategy extends AbstractPackStrategy { 33 34 private static final String IBLOOM_REGEX_COMMENTS = "/\\*[^*]*\\*+([^/][^*]*\\*+)*/"; 35 private static final String IBLOOM_REGEX_SPACES = "(\r\n)|(\r)|(\n)|(\t)|( +)"; 36 private static final String EMPTY_STRING = ""; 37 38 public String pack(InputStream resourceAsStream) throws PackException { 39 String resourceAsString = resourceToString(resourceAsStream); 40 String result = resourceAsString.replaceAll(IBLOOM_REGEX_COMMENTS, EMPTY_STRING); 42 result = result.replaceAll(IBLOOM_REGEX_SPACES, EMPTY_STRING); 44 return result.trim(); 45 } 46 47 } 48 | Popular Tags |