void generateIndexFile ( ) throws DocFileIOException { Content htmlDocType = configuration . isOutputHtml5 ( ) ? DocType . HTML5 : DocType . TRANSITIONAL ; Content htmlComment = new Comment ( configuration . getText ( "doclet.New_Page" ) ) ; Content head = new HtmlTree ( HtmlTag . HEAD ) ; head . addContent ( getGeneratedBy ( ! configuration . notimestamp ) ) ; String title = ( configuration . windowtitle . length ( ) > 0 ) ? configuration . windowtitle : configuration . getText ( "doclet.Generated_Docs_Untitled" ) ; Content windowTitle = HtmlTree . TITLE ( new StringContent ( title ) ) ; head . addContent ( windowTitle ) ; Content metaContentType = HtmlTree . META ( "Content" , CONTENT_TYPE , ( configuration . charset . length ( ) > 0 ) ? configuration . charset : HtmlConstants . HTML_DEFAULT_CHARSET ) ; head . addContent ( metaContentType ) ; String topFilePath = configuration . topFile . getPath ( ) ; String javaScriptRefresh = "window.location.replace('" + topFilePath + "')" ; HtmlTree scriptTree = HtmlTree . SCRIPT ( ) ; scriptTree . addContent ( javaScriptRefresh ) ; head . addContent ( scriptTree ) ; HtmlTree metaRefresh = new HtmlTree ( HtmlTag . META ) ; metaRefresh . addAttr ( HtmlAttr . HTTP_EQUIV , "Refresh" ) ; metaRefresh . addAttr ( HtmlAttr . CONTENT , "0;" + topFilePath ) ; if ( configuration . isOutputHtml5 ( ) ) { head . addContent ( HtmlTree . NOSCRIPT ( metaRefresh ) ) ; } else { head . addContent ( metaRefresh ) ; } head . addContent ( getStyleSheetProperties ( configuration ) ) ; ContentBuilder bodyContent = new ContentBuilder ( ) ; bodyContent . addContent ( HtmlTree . NOSCRIPT ( HtmlTree . P ( configuration . getContent ( "doclet.No_Script_Message" ) ) ) ) ; bodyContent . addContent ( HtmlTree . P ( HtmlTree . A ( topFilePath , new StringContent ( topFilePath ) ) ) ) ; Content body = new HtmlTree ( HtmlTag . BODY ) ; if ( configuration . allowTag ( HtmlTag . MAIN ) ) { HtmlTree main = HtmlTree . MAIN ( bodyContent ) ; body . addContent ( main ) ; } else { body . addContent ( bodyContent ) ; } Content htmlTree = HtmlTree . HTML ( configuration . getLocale ( ) . getLanguage ( ) , head , body ) ; Content htmlDocument = new HtmlDocument ( htmlDocType , htmlComment , htmlTree ) ; write ( htmlDocument ) ; }
Generate an index file that redirects to an alternate file .