private void writeToFile ( Content body , DocPath path ) throws DocFileIOException { Content htmlDocType = configuration . isOutputHtml5 ( ) ? DocType . HTML5 : DocType . TRANSITIONAL ; Content head = new HtmlTree ( HtmlTag . HEAD ) ; head . addContent ( HtmlTree . TITLE ( new StringContent ( configuration . getText ( "doclet.Window_Source_title" ) ) ) ) ; head . addContent ( getStyleSheetProperties ( ) ) ; Content htmlTree = HtmlTree . HTML ( configuration . getLocale ( ) . getLanguage ( ) , head , body ) ; Content htmlDocument = new HtmlDocument ( htmlDocType , htmlTree ) ; messages . notice ( "doclet.Generating_0" , path . getPath ( ) ) ; DocFile df = DocFile . createFileForOutput ( configuration , path ) ; try ( Writer w = df . openWriter ( ) ) { htmlDocument . write ( w , true ) ; } catch ( IOException e ) { throw new DocFileIOException ( df , DocFileIOException . Mode . WRITE , e ) ; } }
Write the output to the file .