langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java
changeset 46079 059faa5e1267
parent 45417 f7479ee8de69
--- a/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Fri Jul 28 14:29:29 2017 -0700
+++ b/langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java	Fri Jul 28 15:00:53 2017 -0700
@@ -170,6 +170,36 @@
     }
 
     /**
+     * Build the extern package list from given URL or the directory path,
+     * as specified with the "-link" flag.
+     * Flag error if the "-link" or "-linkoffline" option is already used.
+     *
+     * @param url        URL or Directory path.
+     * @param reporter   The <code>DocErrorReporter</code> used to report errors.
+     * @return true if successful, false otherwise
+     * @throws DocFileIOException if there is a problem reading a package list file
+     */
+    public boolean link(String url, Reporter reporter) throws DocFileIOException {
+        return link(url, url, reporter, false);
+    }
+
+    /**
+     * Build the extern package list from given URL or the directory path,
+     * as specified with the "-linkoffline" flag.
+     * Flag error if the "-link" or "-linkoffline" option is already used.
+     *
+     * @param url        URL or Directory path.
+     * @param pkglisturl This can be another URL for "package-list" or ordinary
+     *                   file.
+     * @param reporter   The <code>DocErrorReporter</code> used to report errors.
+     * @return true if successful, false otherwise
+     * @throws DocFileIOException if there is a problem reading a package list file
+     */
+    public boolean link(String url, String pkglisturl, Reporter reporter) throws DocFileIOException {
+        return link(url, pkglisturl, reporter, true);
+    }
+
+    /*
      * Build the extern package list from given URL or the directory path.
      * Flag error if the "-link" or "-linkoffline" option is already used.
      *
@@ -181,7 +211,7 @@
      * @return true if successful, false otherwise
      * @throws DocFileIOException if there is a problem reading a package list file
      */
-    public boolean link(String url, String pkglisturl, Reporter reporter, boolean linkoffline)
+    private boolean link(String url, String pkglisturl, Reporter reporter, boolean linkoffline)
                 throws DocFileIOException {
         this.linkoffline = linkoffline;
         try {
@@ -245,8 +275,7 @@
             readPackageList(link.openStream(), urlpath, false);
         } catch (URISyntaxException | MalformedURLException exc) {
             throw new Fault(configuration.getText("doclet.MalformedURL", pkglisturlpath.toString()), exc);
-        }
-        catch (IOException exc) {
+        } catch (IOException exc) {
             throw new Fault(configuration.getText("doclet.URL_error", pkglisturlpath.toString()), exc);
         }
     }