private void copyResources ( File outputDirectory ) throws IOException { copyClasspathResource ( outputDirectory , "reportng.css" , "reportng.css" ) ; copyClasspathResource ( outputDirectory , "reportng.js" , "reportng.js" ) ; // If there is a custom stylesheet, copy that. File customStylesheet = META . getStylesheetPath ( ) ; if ( customStylesheet != null ) { if ( customStylesheet . exists ( ) ) { copyFile ( outputDirectory , customStylesheet , CUSTOM_STYLE_FILE ) ; } else { // If not found, try to read the file as a resource on the classpath // useful when reportng is called by a jarred up library InputStream stream = ClassLoader . getSystemClassLoader ( ) . getResourceAsStream ( customStylesheet . getPath ( ) ) ; if ( stream != null ) { copyStream ( outputDirectory , stream , CUSTOM_STYLE_FILE ) ; } } } }
Reads the CSS and JavaScript files from the JAR file and writes them to the output directory .