elharo commented on a change in pull request #48:
URL: https://github.com/apache/maven-site-plugin/pull/48#discussion_r619700755



##########
File path: src/main/java/org/apache/maven/plugins/site/run/DoxiaFilter.java
##########
@@ -114,6 +116,8 @@ public void doFilter( ServletRequest servletRequest, 
ServletResponse servletResp
                 path = path.substring( languageWanted.length() + 1 );
             }
         }
+        // Set the contentType for the response
+        servletResponse.setContentType( Files.probeContentType( ( new File ( 
path ) ).toPath( ) ) );

Review comment:
       this method can return null

##########
File path: src/main/java/org/apache/maven/plugins/site/run/DoxiaFilter.java
##########
@@ -114,6 +117,20 @@ public void doFilter( ServletRequest servletRequest, 
ServletResponse servletResp
                 path = path.substring( languageWanted.length() + 1 );
             }
         }
+        // Set the contentType for the response
+        if ( null != servletResponse ) 
+        {
+            File file  = new File ( path );
+            Path apath = file.toPath();

Review comment:
       This method does not return null

##########
File path: src/main/java/org/apache/maven/plugins/site/run/DoxiaFilter.java
##########
@@ -114,6 +117,20 @@ public void doFilter( ServletRequest servletRequest, 
ServletResponse servletResp
                 path = path.substring( languageWanted.length() + 1 );
             }
         }
+        // Set the contentType for the response
+        if ( null != servletResponse ) 
+        {
+            File file  = new File ( path );
+            Path apath = file.toPath();
+            if ( null != apath ) 
+            {
+                String contenttype = Files.probeContentType( apath );

Review comment:
       contentType

##########
File path: src/main/java/org/apache/maven/plugins/site/run/DoxiaFilter.java
##########
@@ -114,6 +117,20 @@ public void doFilter( ServletRequest servletRequest, 
ServletResponse servletResp
                 path = path.substring( languageWanted.length() + 1 );
             }
         }
+        // Set the contentType for the response
+        if ( null != servletResponse ) 

Review comment:
       I doubt a null servletResponse is allowed by the servlet spec




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to