protected String getCSS ( ) { // The default styles to use String retVal = "body {\n" + " font-family: Arial, Helvetica, sans-serif;\n" + "}\n" + "h1 {\n" + " font-size: 1.5em;\n" + "}\n" + "th {\n" + " background-color: #9DACBF;\n" + "}\n" + "table {\n" + " border-top-style: solid;\n" + " border-right-style: solid;\n" + " border-bottom-style: solid;\n" + " border-left-style: solid;\n" + "}\n" + "td {\n" + " margin: 0px;\n" + " padding-top: 2px;\n" + " padding-right: 5px;\n" + " padding-bottom: 2px;\n" + " padding-left: 5px;\n" + "}\n" + "tr.even {\n" + " background-color: #CCCCCC;\n" + "}\n" + "tr.odd {\n" + " background-color: #FFFFFF;\n" + "}\n" + "" ; try { // Try loading one via class loader and use that one instead final ClassLoader cl = getClass ( ) . getClassLoader ( ) ; final InputStream iStream = cl . getResourceAsStream ( "webdav.css" ) ; if ( iStream != null ) { // Found css via class loader, use that one final StringBuilder out = new StringBuilder ( ) ; final byte [ ] b = new byte [ 4096 ] ; for ( int n ; ( n = iStream . read ( b ) ) != - 1 ; ) { out . append ( new String ( b , 0 , n ) ) ; } retVal = out . toString ( ) ; } } catch ( final Exception ex ) { LOG . error ( "Error in reading webdav.css" , ex ) ; } return retVal ; }
Return the CSS styles used to display the HTML representation of the webdav content .