1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Wed Oct 17 16:43:26 2012 +0100 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java Tue Oct 23 13:20:37 2012 -0700 1.3 @@ -65,17 +65,12 @@ 1.4 protected PackageDoc packageDoc; 1.5 1.6 /** 1.7 - * The name of the output file. 1.8 - */ 1.9 - private static final String OUTPUT_FILE_NAME = "package-summary.html"; 1.10 - 1.11 - /** 1.12 * Constructor to construct PackageWriter object and to generate 1.13 * "package-summary.html" file in the respective package directory. 1.14 * For example for package "java.lang" this will generate file 1.15 * "package-summary.html" file in the "java/lang" directory. It will also 1.16 * create "java/lang" directory in the current or the destination directory 1.17 - * if it doesen't exist. 1.18 + * if it doesn't exist. 1.19 * 1.20 * @param configuration the configuration of the doclet. 1.21 * @param packageDoc PackageDoc under consideration. 1.22 @@ -83,25 +78,15 @@ 1.23 * @param next Next package in the sorted array. 1.24 */ 1.25 public PackageWriterImpl(ConfigurationImpl configuration, 1.26 - PackageDoc packageDoc, PackageDoc prev, PackageDoc next) 1.27 - throws IOException { 1.28 - super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, 1.29 - DirectoryManager.getRelativePath(packageDoc.name())); 1.30 + PackageDoc packageDoc, PackageDoc prev, PackageDoc next) 1.31 + throws IOException { 1.32 + super(configuration, DocPath.forPackage(packageDoc).resolve(DocPaths.PACKAGE_SUMMARY)); 1.33 this.prev = prev; 1.34 this.next = next; 1.35 this.packageDoc = packageDoc; 1.36 } 1.37 1.38 /** 1.39 - * Return the name of the output file. 1.40 - * 1.41 - * @return the name of the output file. 1.42 - */ 1.43 - public String getOutputFileName() { 1.44 - return OUTPUT_FILE_NAME; 1.45 - } 1.46 - 1.47 - /** 1.48 * {@inheritDoc} 1.49 */ 1.50 public Content getPackageHeader(String heading) { 1.51 @@ -265,7 +250,7 @@ 1.52 * @return a content tree for the class use link 1.53 */ 1.54 protected Content getNavLinkClassUse() { 1.55 - Content useLink = getHyperLink("package-use.html", "", 1.56 + Content useLink = getHyperLink(DocPaths.PACKAGE_USE, "", 1.57 useLabel, "", ""); 1.58 Content li = HtmlTree.LI(useLink); 1.59 return li; 1.60 @@ -281,9 +266,8 @@ 1.61 if (prev == null) { 1.62 li = HtmlTree.LI(prevpackageLabel); 1.63 } else { 1.64 - String path = DirectoryManager.getRelativePath(packageDoc.name(), 1.65 - prev.name()); 1.66 - li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "", 1.67 + DocPath path = DocPath.relativePath(packageDoc, prev); 1.68 + li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), "", 1.69 prevpackageLabel, "", "")); 1.70 } 1.71 return li; 1.72 @@ -299,9 +283,8 @@ 1.73 if (next == null) { 1.74 li = HtmlTree.LI(nextpackageLabel); 1.75 } else { 1.76 - String path = DirectoryManager.getRelativePath(packageDoc.name(), 1.77 - next.name()); 1.78 - li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "", 1.79 + DocPath path = DocPath.relativePath(packageDoc, next); 1.80 + li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY), "", 1.81 nextpackageLabel, "", "")); 1.82 } 1.83 return li; 1.84 @@ -314,7 +297,7 @@ 1.85 * @return a content tree for the tree link 1.86 */ 1.87 protected Content getNavLinkTree() { 1.88 - Content useLink = getHyperLink("package-tree.html", "", 1.89 + Content useLink = getHyperLink(DocPaths.PACKAGE_TREE, "", 1.90 treeLabel, "", ""); 1.91 Content li = HtmlTree.LI(useLink); 1.92 return li;