test_class.declarator: cssFilesProcessor
test_class.modifier: protected
test_class.original_string: protected ThemeCssFilesProcessor cssFilesProcessor;
test_class.type: ThemeCssFilesProcessor
test_class.var_name: cssFilesProcessor
test_class.file: rice-framework/krad-theme-builder/src/test/java/org/kuali/rice/krad/theme/postprocessor/ThemeCssFilesProcessorTest.java
test_class.identifier: ThemeCssFilesProcessorTest
test_case.body: @Test
      public void testRewriteCssUrls() throws Exception {
          String cssString = "#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {\n"
                  + "\tbackground-image: url('fancybox_sprite.png');\n"
                  + "} " + ".infoGrowl{\n"
                  + "\tbackground: url(\"images/information-frame.png\") no-repeat scroll 5px 5px transparent;\n"
                  + "\tpadding-left: 25px;\n"
                  + "}";
  
          String expectedCssString = "#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {\n"
                  + "\tbackground-image: url('../subDir2/fancybox_sprite.png');\n"
                  + "} " + ".infoGrowl{\n"
                  + "\tbackground: url(\"../subDir2/images/information-frame.png\") no-repeat scroll 5px 5px transparent;\n"
                  + "\tpadding-left: 25px;\n"
                  + "}";
  
          File mergedFile = new File("/basedir/subDir1/merge.css");
          File mergeFile = new File("/basedir/subDir2/foo.css");
  
          String rewriteCssString = cssFilesProcessor.rewriteCssUrls(cssString, mergeFile, mergedFile);
  
          Assert.assertEquals("Url not rewritten correctly in css string", expectedCssString, rewriteCssString);
      }
test_case.class_method_signature: ThemeCssFilesProcessorTest.testRewriteCssUrls()
test_case.full_signature: @Test public void testRewriteCssUrls()
test_case.identifier: testRewriteCssUrls
test_case.invocations: rewriteCssUrls assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRewriteCssUrls()
focal_class.declarator: LOG = Logger.getLogger(ThemeCssFilesProcessor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = Logger.getLogger(ThemeCssFilesProcessor.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: linebreak = -1
focal_class.modifier: protected
focal_class.original_string: protected int linebreak = -1;
focal_class.type: int
focal_class.var_name: linebreak
focal_class.file: rice-framework/krad-theme-builder/src/main/java/org/kuali/rice/krad/theme/postprocessor/ThemeCssFilesProcessor.java
focal_class.identifier: ThemeCssFilesProcessor
focal_class.class_method_signature: ThemeCssFilesProcessor.ThemeCssFilesProcessor(String themeName, File themeDirectory, Properties themeProperties,
              Map<String, File> themePluginDirsMap, File workingDir, String projectVersion)
focal_class.full_signature: public  ThemeCssFilesProcessor(String themeName, File themeDirectory, Properties themeProperties,
              Map<String, File> themePluginDirsMap, File workingDir, String projectVersion)
focal_class.identifier: ThemeCssFilesProcessor
focal_class.modifiers: public
focal_class.parameters: (String themeName, File themeDirectory, Properties themeProperties,
              Map<String, File> themePluginDirsMap, File workingDir, String projectVersion)
focal_class.signature:  ThemeCssFilesProcessor(String themeName, File themeDirectory, Properties themeProperties,
              Map<String, File> themePluginDirsMap, File workingDir, String projectVersion)
focal_class.class_method_signature: ThemeCssFilesProcessor.getFileTypeExtension()
focal_class.full_signature: @Override protected String getFileTypeExtension()
focal_class.identifier: getFileTypeExtension
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getFileTypeExtension()
focal_class.class_method_signature: ThemeCssFilesProcessor.getExcludesConfigKey()
focal_class.full_signature: @Override protected String getExcludesConfigKey()
focal_class.identifier: getExcludesConfigKey
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getExcludesConfigKey()
focal_class.class_method_signature: ThemeCssFilesProcessor.getFileTypeDirectoryName()
focal_class.full_signature: @Override protected String getFileTypeDirectoryName()
focal_class.identifier: getFileTypeDirectoryName
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getFileTypeDirectoryName()
focal_class.class_method_signature: ThemeCssFilesProcessor.getFileListingConfigKey()
focal_class.full_signature: @Override protected String getFileListingConfigKey()
focal_class.identifier: getFileListingConfigKey
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getFileListingConfigKey()
focal_class.class_method_signature: ThemeCssFilesProcessor.addAdditionalFiles(List<File> themeFiles)
focal_class.full_signature: @Override protected void addAdditionalFiles(List<File> themeFiles)
focal_class.identifier: addAdditionalFiles
focal_class.modifiers: @Override protected
focal_class.parameters: (List<File> themeFiles)
focal_class.return: void
focal_class.signature: void addAdditionalFiles(List<File> themeFiles)
focal_class.class_method_signature: ThemeCssFilesProcessor.sortThemeFiles(List<File> pluginFiles, List<File> subDirFiles)
focal_class.full_signature: @Override protected List<File> sortThemeFiles(List<File> pluginFiles, List<File> subDirFiles)
focal_class.identifier: sortThemeFiles
focal_class.modifiers: @Override protected
focal_class.parameters: (List<File> pluginFiles, List<File> subDirFiles)
focal_class.return: List<File>
focal_class.signature: List<File> sortThemeFiles(List<File> pluginFiles, List<File> subDirFiles)
focal_class.class_method_signature: ThemeCssFilesProcessor.processMergeFileContents(String fileContents, File fileToMerge, File mergedFile)
focal_class.full_signature: @Override protected String processMergeFileContents(String fileContents, File fileToMerge, File mergedFile)
focal_class.identifier: processMergeFileContents
focal_class.modifiers: @Override protected
focal_class.parameters: (String fileContents, File fileToMerge, File mergedFile)
focal_class.return: String
focal_class.signature: String processMergeFileContents(String fileContents, File fileToMerge, File mergedFile)
focal_class.class_method_signature: ThemeCssFilesProcessor.rewriteCssUrls(String css, File mergeFile, File mergedFile)
focal_class.full_signature: protected String rewriteCssUrls(String css, File mergeFile, File mergedFile)
focal_class.identifier: rewriteCssUrls
focal_class.modifiers: protected
focal_class.parameters: (String css, File mergeFile, File mergedFile)
focal_class.return: String
focal_class.signature: String rewriteCssUrls(String css, File mergeFile, File mergedFile)
focal_class.class_method_signature: ThemeCssFilesProcessor.minify(File mergedFile, File minifiedFile)
focal_class.full_signature: @Override protected void minify(File mergedFile, File minifiedFile)
focal_class.identifier: minify
focal_class.modifiers: @Override protected
focal_class.parameters: (File mergedFile, File minifiedFile)
focal_class.return: void
focal_class.signature: void minify(File mergedFile, File minifiedFile)
focal_class.superclass: extends ThemeFilesProcessor
focal_method.body: protected String rewriteCssUrls(String css, File mergeFile, File mergedFile) throws IOException {
          String urlAdjustment = ThemeBuilderUtils.calculatePathToFile(mergedFile, mergeFile);
  
          if (StringUtils.isBlank(urlAdjustment)) {
              // no adjustment needed
              return css;
          }
  
          // match all URLs in css string and then adjust each one
          Pattern urlPattern = Pattern.compile(ThemeBuilderConstants.Patterns.CSS_URL_PATTERN);
  
          Matcher matcher = urlPattern.matcher(css);
  
          StringBuffer sb = new StringBuffer();
          while (matcher.find()) {
              String cssStatement = matcher.group();
  
              String cssUrl = null;
              if (matcher.group(1) != null) {
                  cssUrl = matcher.group(1);
              } else {
                  cssUrl = matcher.group(2);
              }
  
              if (cssUrl != null) {
                  // only adjust URL if it is relative
                  String modifiedUrl = cssUrl;
  
                  if (!cssUrl.startsWith("/")) {
                      modifiedUrl = urlAdjustment + cssUrl;
                  }
  
                  String modifiedStatement = Matcher.quoteReplacement(cssStatement.replace(cssUrl, modifiedUrl));
  
                  matcher.appendReplacement(sb, modifiedStatement);
              }
          }
  
          matcher.appendTail(sb);
  
          return sb.toString();
      }
focal_method.class_method_signature: ThemeCssFilesProcessor.rewriteCssUrls(String css, File mergeFile, File mergedFile)
focal_method.full_signature: protected String rewriteCssUrls(String css, File mergeFile, File mergedFile)
focal_method.identifier: rewriteCssUrls
focal_method.invocations: calculatePathToFile isBlank compile matcher find group group group group startsWith quoteReplacement replace appendReplacement appendTail toString
focal_method.modifiers: protected
focal_method.parameters: (String css, File mergeFile, File mergedFile)
focal_method.return: String
focal_method.signature: String rewriteCssUrls(String css, File mergeFile, File mergedFile)