mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Make "normalizing" the file-path actually work
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888021 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
799dfc40f4
commit
5866b2129c
@ -89,7 +89,7 @@ public abstract class AbstractFileHandler implements FileHandler {
|
||||
String fileAndParentName = file.getParentFile().getName() + "/" + file.getName();
|
||||
try {
|
||||
// fix windows absolute paths for exception message tracking
|
||||
String relPath = file.getPath().replace(".*test-data", "test-data").replace('\\', '/');
|
||||
String relPath = file.getPath().replaceAll(".*test-data", "test-data").replace('\\', '/');
|
||||
extractor = ExtractorFactory.createExtractor(file);
|
||||
assertNotNull(extractor, "Should get a POITextExtractor but had none for file " + relPath);
|
||||
|
||||
|
||||
@ -222,6 +222,11 @@ class XSSFFileHandler extends SpreadsheetHandler {
|
||||
handleExtracting(file);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testExtracting() throws Exception {
|
||||
handleExtracting(new File("test-data/spreadsheet/ref-56737.xlsx"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAdditional() throws Exception {
|
||||
handleAdditional(new File("test-data/spreadsheet/poc-xmlbomb.xlsx"));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user