}\r
} catch (IllegalArgumentException e) {\r
if(!EXPECTED_EXTRACTOR_FAILURES.contains(file)) {\r
- throw new Exception("While handling " + file, e);\r
+ throw e;\r
}\r
} finally {\r
extractor.close();\r
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
stream.close();
}
}
+
+ // a test-case to test this locally without executing the full TestAllFiles
+ @Test
+ public void testExtractor() throws Exception {
+ handleExtracting(new File("test-data/slideshow/ae.ac.uaeu.faculty_nafaachbili_GeomLec1.pptx"));
+ }
}
if (DateUtil.isValidExcelDate(numericValue)) {
return getApplicableFormatPart(numericValue).apply(value);
} else {
- throw new IllegalArgumentException("value not a valid Excel date");
+ throw new IllegalArgumentException("value " + numericValue + " of date " + value + " is not a valid Excel date");
}
} else {
return textFmt.apply(value);
public final static String NAMESPACE_DCTERMS_URI = "http://purl.org/dc/terms/";
- private final static String DEFAULT_DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
+ private final static String DEFAULT_DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
private final static String ALTERNATIVE_DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss.SS'Z'";
try {
this.created = setDateValue(created);
} catch (InvalidFormatException e) {
- throw new IllegalArgumentException("created : "
- + e.getLocalizedMessage(), e);
+ throw new IllegalArgumentException("Date for created could not be parsed: " + created, e);
}
}
d = df.parse(dateTzStr, new ParsePosition(0));
}
if (d == null) {
- throw new InvalidFormatException("Date not well formated");
+ throw new InvalidFormatException("Date " + dateTzStr + " not well formated, "
+ + "expected format " + DEFAULT_DATEFORMAT + " or " + ALTERNATIVE_DATEFORMAT);
}
return new Nullable<Date>(d);
}
wb.getCreationHelper().createFormulaEvaluator().evaluateAll();
CalculationChain chain = ((XSSFWorkbook)wb).getCalculationChain();
- CTCalcCell[] cArray = chain.getCTCalcChain().getCArray();
- for(CTCalcCell calc : cArray) {
+ for(CTCalcCell calc : chain.getCTCalcChain().getCList()) {
// A2 to A6 should be gone
assertFalse(calc.getR().equals("A2"));
assertFalse(calc.getR().equals("A3"));
assertNotNull(sheetBack);
chain = ((XSSFWorkbook)wbBack).getCalculationChain();
- cArray = chain.getCTCalcChain().getCArray();
- for(CTCalcCell calc : cArray) {
+ for(CTCalcCell calc : chain.getCTCalcChain().getCList()) {
// A2 to A6 should be gone
assertFalse(calc.getR().equals("A2"));
assertFalse(calc.getR().equals("A3"));