175 try { |
177 try { |
176 url = adjustEndFileSeparator(url); |
178 url = adjustEndFileSeparator(url); |
177 if (isUrl(pkglisturl)) { |
179 if (isUrl(pkglisturl)) { |
178 readPackageListFromURL(url, toURL(pkglisturl)); |
180 readPackageListFromURL(url, toURL(pkglisturl)); |
179 } else { |
181 } else { |
180 readPackageListFromFile(url, new File(pkglisturl)); |
182 readPackageListFromFile(url, DocFile.createFileForInput(configuration, pkglisturl)); |
181 } |
183 } |
182 return true; |
184 return true; |
183 } catch (Fault f) { |
185 } catch (Fault f) { |
184 reporter.printWarning(f.getMessage()); |
186 reporter.printWarning(f.getMessage()); |
185 return false; |
187 return false; |
245 * Read the "package-list" file which is available locally. |
247 * Read the "package-list" file which is available locally. |
246 * |
248 * |
247 * @param path URL or directory path to the packages. |
249 * @param path URL or directory path to the packages. |
248 * @param pkgListPath Path to the local "package-list" file. |
250 * @param pkgListPath Path to the local "package-list" file. |
249 */ |
251 */ |
250 private void readPackageListFromFile(String path, File pkgListPath) |
252 private void readPackageListFromFile(String path, DocFile pkgListPath) |
251 throws Fault { |
253 throws Fault { |
252 File file = new File(pkgListPath, "package-list"); |
254 DocFile file = pkgListPath.resolve(DocPaths.PACKAGE_LIST); |
253 if (! (file.isAbsolute() || linkoffline)){ |
255 if (! (file.isAbsolute() || linkoffline)){ |
254 file = new File(configuration.destDirName, file.getPath()); |
256 file = file.resolveAgainst(StandardLocation.CLASS_OUTPUT); |
255 } |
257 } |
256 try { |
258 try { |
257 if (file.exists() && file.canRead()) { |
259 if (file.exists() && file.canRead()) { |
258 readPackageList(new FileInputStream(file), path, |
260 boolean pathIsRelative = |
259 ! ((new File(path)).isAbsolute() || isUrl(path))); |
261 !DocFile.createFileForInput(configuration, path).isAbsolute() |
|
262 && !isUrl(path); |
|
263 readPackageList(file.openInputStream(), path, pathIsRelative); |
260 } else { |
264 } else { |
261 throw new Fault(configuration.getText("doclet.File_error", file.getPath()), null); |
265 throw new Fault(configuration.getText("doclet.File_error", file.getPath()), null); |
262 } |
266 } |
263 } catch (IOException exc) { |
267 } catch (IOException exc) { |
264 throw new Fault(configuration.getText("doclet.File_error", file.getPath()), exc); |
268 throw new Fault(configuration.getText("doclet.File_error", file.getPath()), exc); |