diff --git a/generate-domino-update-site/src/main/java/org/openntf/p2/domino/updatesite/tasks/GenerateUpdateSiteTask.java b/generate-domino-update-site/src/main/java/org/openntf/p2/domino/updatesite/tasks/GenerateUpdateSiteTask.java index 099531f..23b75fb 100644 --- a/generate-domino-update-site/src/main/java/org/openntf/p2/domino/updatesite/tasks/GenerateUpdateSiteTask.java +++ b/generate-domino-update-site/src/main/java/org/openntf/p2/domino/updatesite/tasks/GenerateUpdateSiteTask.java @@ -674,7 +674,7 @@ private Document fetchEclipseArtifacts() throws MalformedURLException { * @since 3.3.0 */ private void downloadSource(Path artifact, Path destDir, Document artifacts) throws Exception { - String fileName = artifact.getFileName().toString(); + String fileName = StringUtil.toString(artifact.getFileName()); Matcher matcher = BUNDLE_FILENAME_PATTERN.matcher(fileName); if(matcher.matches()) { String symbolicName = matcher.group(1) + ".source"; //$NON-NLS-1$ @@ -682,7 +682,7 @@ private void downloadSource(Path artifact, Path destDir, Document artifacts) thr String query = StringUtil.format("/repository/artifacts/artifact[@classifier='osgi.bundle'][@id='{0}'][@version='{1}']", symbolicName, version); //$NON-NLS-1$ NodeList result = NSFODPDomUtil.selectNodes(artifacts, query); - if(result.getLength() > 0) { + if(result != null && result.getLength() > 0) { // Then we can be confident that it will exist at the expected URL String bundleName = StringUtil.format("{0}_{1}.jar", symbolicName, version); //$NON-NLS-1$ Path dest = destDir.resolve(bundleName); @@ -692,12 +692,12 @@ private void downloadSource(Path artifact, Path destDir, Document artifacts) thr URL bundleUrl = new URL(urlString); try(InputStream is = bundleUrl.openStream()) { if(log.isInfoEnabled()) { - log.info(Messages.getString("GenerateUpdateSiteTask.downloadingSourceBundle") + artifact.getFileName().toString()); //$NON-NLS-1$ + log.info(Messages.getString("GenerateUpdateSiteTask.downloadingSourceBundle", artifact.getFileName())); //$NON-NLS-1$ } Files.copy(is, dest, StandardCopyOption.REPLACE_EXISTING); - } catch(IOException e) { + } catch(Exception e) { if(log.isWarnEnabled()) { - log.warn(Messages.getString("GenerateUpdateSiteTask.unableToDownloadSourceBundle") + urlString, e); //$NON-NLS-1$ + log.warn(Messages.getString("GenerateUpdateSiteTask.unableToDownloadSourceBundle", urlString), e); //$NON-NLS-1$ } } } diff --git a/generate-domino-update-site/src/main/resources/org/openntf/p2/domino/updatesite/messages.properties b/generate-domino-update-site/src/main/resources/org/openntf/p2/domino/updatesite/messages.properties index 7c6b328..77a5e7e 100644 --- a/generate-domino-update-site/src/main/resources/org/openntf/p2/domino/updatesite/messages.properties +++ b/generate-domino-update-site/src/main/resources/org/openntf/p2/domino/updatesite/messages.properties @@ -6,12 +6,12 @@ GenerateUpdateSiteTask.0=Unable to locate xsp.http.bootstrap.jar - skipping bund GenerateUpdateSiteTask.copying=Copying GenerateUpdateSiteTask.directoryExistsAsFile=Planned directory exists as a file: GenerateUpdateSiteTask.directoryNotExists=Directory does not exist: -GenerateUpdateSiteTask.downloadingSourceBundle=- Downloading source bundle +GenerateUpdateSiteTask.downloadingSourceBundle=- Downloading source bundle {0} GenerateUpdateSiteTask.errorWritingSiteXml=Error writing site.xml file GenerateUpdateSiteTask.exceptionBuildingSiteXml=Exception while building site.xml document GenerateUpdateSiteTask.mismatchedFilename=Could not match filename pattern to GenerateUpdateSiteTask.repoDirDoesNotExist=Repository directory does not exist. -GenerateUpdateSiteTask.unableToDownloadSourceBundle=Unable to download source bundle +GenerateUpdateSiteTask.unableToDownloadSourceBundle=Unable to download source bundle\: {0} GenerateUpdateSiteTask.unableToFindFeatures=Unable to find features directory: GenerateUpdateSiteTask.unableToLoadNeon=Unable to load Neon artifacts.xml.xz GenerateUpdateSiteTask.unableToLocateLibExtJar=Unable to locate {0} within {1}