You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/07/26 14:33:28 UTC

[GitHub] [maven-javadoc-plugin] anthonyvdotbe commented on a change in pull request #51: [MJAVADOC-623] - Fall back to downloading element-list

anthonyvdotbe commented on a change in pull request #51:
URL: https://github.com/apache/maven-javadoc-plugin/pull/51#discussion_r460534974



##########
File path: src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java
##########
@@ -6407,20 +6410,41 @@ else if ( javaApiversion.asMajor().isAtLeast( "9" ) )
         link.setUrl( javaApiLink );
 
         InputStream in = this.getClass().getResourceAsStream( resourceName );
-        if ( in != null )
+        if ( in == null )
         {
-            try ( InputStream closableIS = in )
+            String elementListLink = javaApiLink + "element-list";
+            try
             {
-                // TODO only copy when changed
-                Files.copy( closableIS, javaApiListFile, StandardCopyOption.REPLACE_EXISTING );
+                URL elementListUrl = new URL( elementListLink );
+                String elementListContent = (String) elementListUrl.getContent( new Class<?>[] { String.class } );
+                if ( elementListContent != null )
+                {
+                    in = new ByteArrayInputStream( elementListContent.getBytes( UTF_8 ) );

Review comment:
       Thanks for the review, that's much better indeed.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org