diff --git a/apache-poi-2/.gitignore b/apache-poi-2/.gitignore index 9552c1e63d..d5c7c78cb1 100644 --- a/apache-poi-2/.gitignore +++ b/apache-poi-2/.gitignore @@ -1,3 +1,4 @@ *.docx temp.xls temp.xlsx +number_test.xlsx diff --git a/apache-poi-2/README.md b/apache-poi-2/README.md index d810c40815..2fd0135b11 100644 --- a/apache-poi-2/README.md +++ b/apache-poi-2/README.md @@ -1,10 +1,12 @@ ## Apache POI -This module contains articles about Apache POI +This module contains articles about Apache POI. ### Relevant Articles: - [Adding a Column to an Excel Sheet Using Apache POI](https://www.baeldung.com/java-excel-add-column) - [Add an Image to a Cell in an Excel File With Java](https://www.baeldung.com/java-add-image-excel) - [Numeric Format Using POI](https://www.baeldung.com/apache-poi-numeric-format) -- More articles: [[<-- prev]](/apache-poi) +- [Microsoft Word Processing in Java with Apache POI](https://www.baeldung.com/java-microsoft-word-with-apache-poi) +- [Creating a MS PowerPoint Presentation in Java](https://www.baeldung.com/apache-poi-slideshow) +- More articles: [[<-- prev]](../apache-poi) diff --git a/apache-poi/src/main/java/com/baeldung/poi/powerpoint/PowerPointHelper.java b/apache-poi-2/src/main/java/com/baeldung/poi/powerpoint/PowerPointHelper.java similarity index 89% rename from apache-poi/src/main/java/com/baeldung/poi/powerpoint/PowerPointHelper.java rename to apache-poi-2/src/main/java/com/baeldung/poi/powerpoint/PowerPointHelper.java index e2af4f8808..5b40301de5 100644 --- a/apache-poi/src/main/java/com/baeldung/poi/powerpoint/PowerPointHelper.java +++ b/apache-poi-2/src/main/java/com/baeldung/poi/powerpoint/PowerPointHelper.java @@ -5,7 +5,22 @@ import org.apache.poi.sl.usermodel.PictureData; import org.apache.poi.sl.usermodel.TableCell; import org.apache.poi.sl.usermodel.TextParagraph; import org.apache.poi.util.IOUtils; -import org.apache.poi.xslf.usermodel.*; +import org.apache.poi.xslf.usermodel.SlideLayout; +import org.apache.poi.xslf.usermodel.XMLSlideShow; +import org.apache.poi.xslf.usermodel.XSLFAutoShape; +import org.apache.poi.xslf.usermodel.XSLFHyperlink; +import org.apache.poi.xslf.usermodel.XSLFPictureData; +import org.apache.poi.xslf.usermodel.XSLFPictureShape; +import org.apache.poi.xslf.usermodel.XSLFShape; +import org.apache.poi.xslf.usermodel.XSLFSlide; +import org.apache.poi.xslf.usermodel.XSLFSlideLayout; +import org.apache.poi.xslf.usermodel.XSLFSlideMaster; +import org.apache.poi.xslf.usermodel.XSLFTable; +import org.apache.poi.xslf.usermodel.XSLFTableCell; +import org.apache.poi.xslf.usermodel.XSLFTableRow; +import org.apache.poi.xslf.usermodel.XSLFTextParagraph; +import org.apache.poi.xslf.usermodel.XSLFTextRun; +import org.apache.poi.xslf.usermodel.XSLFTextShape; import java.awt.*; import java.io.FileInputStream; @@ -155,8 +170,8 @@ public class PowerPointHelper { /** * Retrieve the placeholder inside a slide - * - * @param slide + * + * @param slide * The slide * @return List of placeholder inside a slide */ diff --git a/apache-poi/src/main/java/com/baeldung/poi/word/WordDocument.java b/apache-poi-2/src/main/java/com/baeldung/poi/word/WordDocument.java similarity index 93% rename from apache-poi/src/main/java/com/baeldung/poi/word/WordDocument.java rename to apache-poi-2/src/main/java/com/baeldung/poi/word/WordDocument.java index 599da86eaa..ee754beeb9 100644 --- a/apache-poi/src/main/java/com/baeldung/poi/word/WordDocument.java +++ b/apache-poi-2/src/main/java/com/baeldung/poi/word/WordDocument.java @@ -1,7 +1,11 @@ package com.baeldung.poi.word; import org.apache.poi.util.Units; -import org.apache.poi.xwpf.usermodel.*; +import org.apache.poi.xwpf.usermodel.ParagraphAlignment; +import org.apache.poi.xwpf.usermodel.UnderlinePatterns; +import org.apache.poi.xwpf.usermodel.XWPFDocument; +import org.apache.poi.xwpf.usermodel.XWPFParagraph; +import org.apache.poi.xwpf.usermodel.XWPFRun; import java.io.FileOutputStream; import java.io.IOException; diff --git a/apache-poi/src/main/resources/logo-leaf.png b/apache-poi-2/src/main/resources/logo-leaf.png similarity index 100% rename from apache-poi/src/main/resources/logo-leaf.png rename to apache-poi-2/src/main/resources/logo-leaf.png diff --git a/apache-poi/src/main/resources/poi-word-para1.txt b/apache-poi-2/src/main/resources/poi-word-para1.txt similarity index 100% rename from apache-poi/src/main/resources/poi-word-para1.txt rename to apache-poi-2/src/main/resources/poi-word-para1.txt diff --git a/apache-poi/src/main/resources/poi-word-para2.txt b/apache-poi-2/src/main/resources/poi-word-para2.txt similarity index 100% rename from apache-poi/src/main/resources/poi-word-para2.txt rename to apache-poi-2/src/main/resources/poi-word-para2.txt diff --git a/apache-poi/src/main/resources/poi-word-para3.txt b/apache-poi-2/src/main/resources/poi-word-para3.txt similarity index 100% rename from apache-poi/src/main/resources/poi-word-para3.txt rename to apache-poi-2/src/main/resources/poi-word-para3.txt diff --git a/apache-poi/src/test/java/com/baeldung/poi/powerpoint/PowerPointIntegrationTest.java b/apache-poi-2/src/test/java/com/baeldung/poi/powerpoint/PowerPointIntegrationTest.java similarity index 99% rename from apache-poi/src/test/java/com/baeldung/poi/powerpoint/PowerPointIntegrationTest.java rename to apache-poi-2/src/test/java/com/baeldung/poi/powerpoint/PowerPointIntegrationTest.java index 7253238e80..aff0ab3821 100644 --- a/apache-poi/src/test/java/com/baeldung/poi/powerpoint/PowerPointIntegrationTest.java +++ b/apache-poi-2/src/test/java/com/baeldung/poi/powerpoint/PowerPointIntegrationTest.java @@ -1,8 +1,5 @@ package com.baeldung.poi.powerpoint; -import java.io.File; -import java.util.List; - import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xslf.usermodel.XSLFShape; import org.apache.poi.xslf.usermodel.XSLFSlide; @@ -13,12 +10,15 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import java.io.File; +import java.util.List; + public class PowerPointIntegrationTest { private PowerPointHelper pph; private String fileLocation; private static final String FILE_NAME = "presentation.pptx"; - + @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); diff --git a/apache-poi/src/test/java/com/baeldung/poi/word/WordIntegrationTest.java b/apache-poi-2/src/test/java/com/baeldung/poi/word/WordIntegrationTest.java similarity index 100% rename from apache-poi/src/test/java/com/baeldung/poi/word/WordIntegrationTest.java rename to apache-poi-2/src/test/java/com/baeldung/poi/word/WordIntegrationTest.java index 98b5c5b520..fe83aa4a4d 100644 --- a/apache-poi/src/test/java/com/baeldung/poi/word/WordIntegrationTest.java +++ b/apache-poi-2/src/test/java/com/baeldung/poi/word/WordIntegrationTest.java @@ -1,19 +1,19 @@ package com.baeldung.poi.word; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; - import org.apache.poi.xwpf.usermodel.XWPFDocument; import org.apache.poi.xwpf.usermodel.XWPFParagraph; import org.apache.poi.xwpf.usermodel.XWPFRun; import org.junit.BeforeClass; import org.junit.Test; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + public class WordIntegrationTest { static WordDocument wordDocument; diff --git a/apache-poi/README.md b/apache-poi/README.md index 3dc58fe1b4..34e7631087 100644 --- a/apache-poi/README.md +++ b/apache-poi/README.md @@ -1,12 +1,10 @@ ## Apache POI -This module contains articles about Apache POI +This module contains articles about Apache POI. ### Relevant Articles: -- [Microsoft Word Processing in Java with Apache POI](https://www.baeldung.com/java-microsoft-word-with-apache-poi) - [Working with Microsoft Excel in Java](https://www.baeldung.com/java-microsoft-excel) -- [Creating a MS PowerPoint Presentation in Java](https://www.baeldung.com/apache-poi-slideshow) - [Merge Cells in Excel Using Apache POI](https://www.baeldung.com/java-apache-poi-merge-cells) - [Get String Value of Excel Cell with Apache POI](https://www.baeldung.com/java-apache-poi-cell-string-value) - [Read Excel Cell Value Rather Than Formula With Apache POI](https://www.baeldung.com/apache-poi-read-cell-value-formula) @@ -16,4 +14,4 @@ This module contains articles about Apache POI - [Set Background Color of a Cell with Apache POI](https://www.baeldung.com/apache-poi-background-color) - [Add Borders to Excel Cells With Apache POI](https://www.baeldung.com/apache-poi-add-borders) - [Reading Values From Excel in Java](https://www.baeldung.com/java-read-dates-excel) -- More articles: [[next -->]](/apache-poi-2) +- More articles: [[next -->]](../apache-poi-2)