kdebski85 commented on code in PR #352:
URL: https://github.com/apache/poi/pull/352#discussion_r1086343835


##########
poi-examples/src/main/java/org/apache/poi/examples/xwpf/usermodel/BetterHeaderFooterExample.java:
##########
@@ -48,7 +49,7 @@ public static void main(String[] args) throws IOException {
             XWPFFooter foot = doc.createFooter(HeaderFooterType.DEFAULT);
             foot.createParagraph().createRun().setText("footer");
 
-            try (OutputStream os = new FileOutputStream(new 
File("header2.docx"))) {
+            try (OutputStream os = Files.newOutputStream(new 
File("header2.docx").toPath())) {

Review Comment:
   Instead of creating `File` object and then using `toPath()` to convert to 
`Path`, you can directly create `Path` object with `java.nio.file.Paths::get` 
static method.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to