JAVA-9566: Update apache-poi version and articles (#11748)
* JAVA-9566: Update apache-poi version and articles * JAVA-9566: Update apache-poi version and articles
This commit is contained in:
parent
69e04d5ac0
commit
ef127cbdfb
@ -33,7 +33,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<poi.version>4.1.1</poi.version>
|
<poi.version>5.2.0</poi.version>
|
||||||
<jexcel.version>1.0.6</jexcel.version>
|
<jexcel.version>1.0.6</jexcel.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
package com.baeldung.poi.excel;
|
package com.baeldung.poi.excel;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellType;
|
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
|
import org.apache.poi.ss.usermodel.DateUtil;
|
||||||
|
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||||
import org.apache.poi.ss.usermodel.Row;
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
||||||
import org.apache.poi.xssf.usermodel.XSSFFont;
|
import org.apache.poi.xssf.usermodel.XSSFFont;
|
||||||
import org.apache.poi.ss.usermodel.DateUtil;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
import org.apache.poi.ss.usermodel.FillPatternType;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ExcelPOIHelper {
|
public class ExcelPOIHelper {
|
||||||
|
|
||||||
@ -33,7 +32,7 @@ public class ExcelPOIHelper {
|
|||||||
for (Row row : sheet) {
|
for (Row row : sheet) {
|
||||||
data.put(i, new ArrayList<String>());
|
data.put(i, new ArrayList<String>());
|
||||||
for (Cell cell : row) {
|
for (Cell cell : row) {
|
||||||
switch (cell.getCellTypeEnum()) {
|
switch (cell.getCellType()) {
|
||||||
case STRING:
|
case STRING:
|
||||||
data.get(i)
|
data.get(i)
|
||||||
.add(cell.getRichStringCellValue()
|
.add(cell.getRichStringCellValue()
|
||||||
|
@ -44,6 +44,7 @@ public class ExcelUtility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
inputStream.close();
|
inputStream.close();
|
||||||
|
baeuldungWorkBook.close();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.baeldung.poi.excel.cellstyle;
|
package com.baeldung.poi.excel.cellstyle;
|
||||||
|
|
||||||
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
|
import org.apache.poi.hssf.util.HSSFColor.HSSFColorPredefined;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
import org.apache.poi.ss.usermodel.Font;
|
import org.apache.poi.ss.usermodel.Font;
|
||||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
package com.baeldung.jexcel;
|
package com.baeldung.jexcel;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import jxl.read.biff.BiffException;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.baeldung.jexcel.JExcelHelper;
|
|
||||||
|
|
||||||
import jxl.write.WriteException;
|
|
||||||
import jxl.read.biff.BiffException;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
import java.io.File;
|
||||||
import org.junit.Before;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import jxl.read.biff.BiffException;
|
||||||
|
import jxl.write.WriteException;
|
||||||
|
|
||||||
public class JExcelIntegrationTest {
|
public class JExcelIntegrationTest {
|
||||||
|
|
||||||
|
@ -1,22 +1,15 @@
|
|||||||
package com.baeldung.poi.excel;
|
package com.baeldung.poi.excel;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import jxl.read.biff.BiffException;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.baeldung.poi.excel.ExcelPOIHelper;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
import java.io.File;
|
||||||
import org.junit.Before;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
public class ExcelIntegrationTest {
|
public class ExcelIntegrationTest {
|
||||||
|
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
package com.baeldung.poi.excel.cellstyle;
|
package com.baeldung.poi.excel.cellstyle;
|
||||||
|
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||||
|
import org.apache.poi.ss.usermodel.Row;
|
||||||
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
public class CellStyleHandlerUnitTest {
|
public class CellStyleHandlerUnitTest {
|
||||||
private static final String FILE_NAME = "cellstyle/CellStyleHandlerTest.xlsx";
|
private static final String FILE_NAME = "cellstyle/CellStyleHandlerTest.xlsx";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user