< prev index next >

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Extern.java

Print this page
rev 47870 : imported patch 8180019-0.patch


 206      * @param url        URL or Directory path.
 207      * @param pkglisturl This can be another URL for "package-list" or ordinary
 208      *                   file.
 209      * @param reporter   The <code>DocErrorReporter</code> used to report errors.
 210      * @param linkoffline True if -linkoffline is used and false if -link is used.
 211      * @return true if successful, false otherwise
 212      * @throws DocFileIOException if there is a problem reading a package list file
 213      */
 214     private boolean link(String url, String pkglisturl, Reporter reporter, boolean linkoffline)
 215                 throws DocFileIOException {
 216         this.linkoffline = linkoffline;
 217         try {
 218             url = adjustEndFileSeparator(url);
 219             if (isUrl(pkglisturl)) {
 220                 readPackageListFromURL(url, toURL(adjustEndFileSeparator(pkglisturl)));
 221             } else {
 222                 readPackageListFromFile(url, DocFile.createFileForInput(configuration, pkglisturl));
 223             }
 224             return true;
 225         } catch (Fault f) {
 226             reporter.print(Diagnostic.Kind.WARNING, f.getMessage());
 227             return false;
 228         }
 229     }
 230 
 231     private URL toURL(String url) throws Fault {
 232         try {
 233             return new URL(url);
 234         } catch (MalformedURLException e) {
 235             throw new Fault(configuration.getText("doclet.MalformedURL", url), e);
 236         }
 237     }
 238 
 239     private class Fault extends Exception {
 240         private static final long serialVersionUID = 0;
 241 
 242         Fault(String msg, Exception cause) {
 243             super(msg, cause);
 244         }
 245     }
 246 




 206      * @param url        URL or Directory path.
 207      * @param pkglisturl This can be another URL for "package-list" or ordinary
 208      *                   file.
 209      * @param reporter   The <code>DocErrorReporter</code> used to report errors.
 210      * @param linkoffline True if -linkoffline is used and false if -link is used.
 211      * @return true if successful, false otherwise
 212      * @throws DocFileIOException if there is a problem reading a package list file
 213      */
 214     private boolean link(String url, String pkglisturl, Reporter reporter, boolean linkoffline)
 215                 throws DocFileIOException {
 216         this.linkoffline = linkoffline;
 217         try {
 218             url = adjustEndFileSeparator(url);
 219             if (isUrl(pkglisturl)) {
 220                 readPackageListFromURL(url, toURL(adjustEndFileSeparator(pkglisturl)));
 221             } else {
 222                 readPackageListFromFile(url, DocFile.createFileForInput(configuration, pkglisturl));
 223             }
 224             return true;
 225         } catch (Fault f) {
 226             reporter.print(Diagnostic.Kind.ERROR, f.getMessage());
 227             return false;
 228         }
 229     }
 230 
 231     private URL toURL(String url) throws Fault {
 232         try {
 233             return new URL(url);
 234         } catch (MalformedURLException e) {
 235             throw new Fault(configuration.getText("doclet.MalformedURL", url), e);
 236         }
 237     }
 238 
 239     private class Fault extends Exception {
 240         private static final long serialVersionUID = 0;
 241 
 242         Fault(String msg, Exception cause) {
 243             super(msg, cause);
 244         }
 245     }
 246 


< prev index next >