private static String inlineCssImports(final String css, final String basePath) {
        String retValue = css;
        int start;
        while ((start = retValue.indexOf(CSS_IMPORT_START)) != -1) {
            int end = retValue.indexOf(CSS_IMPORT_END, start);
            if (end != -1) {
                final String filePath = retValue.substring(start + CSS_IMPORT_START.length(), end);
                final String fileData = FileUtilities.readFileContents(new File(basePath + "/" + filePath));

                retValue = retValue.replace(CSS_IMPORT_START + filePath + CSS_IMPORT_END, fileData);
            }
        }
        return retValue;
    }
private static String inlineCssImports ( final String css , final String basePath ) { String retValue = css ; int start ; while ( ( start = retValue . indexOf ( CSS_IMPORT_START ) ) != - 1 ) { int end = retValue . indexOf ( CSS_IMPORT_END , start ) ; if ( end != - 1 ) { final String filePath = retValue . substring ( start + CSS_IMPORT_START . length ( ) , end ) ; final String fileData = FileUtilities . readFileContents ( new File ( basePath + "/" + filePath ) ) ; retValue = retValue . replace ( CSS_IMPORT_START + filePath + CSS_IMPORT_END , fileData ) ; } } return retValue ; }
Finds any reference to an external CSS scripts that themselves have been
referenced in a CSS script using an import statement and replaces the
node with inline CSS data.

@param doc      The document that holds the XHTML
@param basePath The base path where the CSS scripts can be found