1 /* |
1 /* |
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
37 import jdk.javadoc.internal.doclets.toolkit.Content; |
37 import jdk.javadoc.internal.doclets.toolkit.Content; |
38 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
38 import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; |
39 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
39 import jdk.javadoc.internal.doclets.toolkit.util.DocPath; |
40 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
40 import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; |
41 |
41 |
42 import static jdk.javadoc.internal.doclets.formats.html.markup.HtmlDocWriter.CONTENT_TYPE; |
|
43 |
|
44 /** |
42 /** |
45 * Writes an index.html file that tries to redirect to an alternate page. |
43 * Writes an index.html file that tries to redirect to an alternate page. |
46 * The redirect uses JavaSCript, if enabled, falling back on |
44 * The redirect uses JavaSCript, if enabled, falling back on |
47 * {@code <meta http-eqiv=refresh content="0,<uri>">}. |
45 * {@code <meta http-eqiv=refresh content="0,<uri>">}. |
48 * If neither are supported/enabled in a browser, the page displays the |
46 * If neither are supported/enabled in a browser, the page displays the |
49 * standard "JavaScipt not enabled" message, and a link to the alternate page. |
47 * standard "JavaScipt not enabled" message, and a link to the alternate page. |
50 */ |
48 */ |
51 public class IndexRedirectWriter extends HtmlDocletWriter { |
49 public class IndexRedirectWriter extends HtmlDocletWriter { |
52 |
50 |
53 public static void generate(ConfigurationImpl configuration) |
51 public static void generate(HtmlConfiguration configuration) |
54 throws DocFileIOException { |
52 throws DocFileIOException { |
55 IndexRedirectWriter indexRedirect; |
53 IndexRedirectWriter indexRedirect; |
56 DocPath filename = DocPaths.INDEX; |
54 DocPath filename = DocPaths.INDEX; |
57 indexRedirect = new IndexRedirectWriter(configuration, filename); |
55 indexRedirect = new IndexRedirectWriter(configuration, filename); |
58 indexRedirect.generateIndexFile(); |
56 indexRedirect.generateIndexFile(); |
59 } |
57 } |
60 |
58 |
61 IndexRedirectWriter(ConfigurationImpl configuration, DocPath filename) { |
59 IndexRedirectWriter(HtmlConfiguration configuration, DocPath filename) { |
62 super(configuration, filename); |
60 super(configuration, filename); |
63 } |
61 } |
64 |
62 |
65 /** |
63 /** |
66 * Generate an index file that redirects to an alternate file. |
64 * Generate an index file that redirects to an alternate file. |