Merge branch 'master' of github.com:ZUGFeRD/mustangproject
This commit is contained in:
@@ -126,8 +126,7 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
if (Arrays.equals(pad, pdfSignature)) { // we have a pdf
|
if (Arrays.equals(pad, pdfSignature)) { // we have a pdf
|
||||||
|
|
||||||
|
|
||||||
try {
|
try(PDDocument doc = Loader.loadPDF(IOUtils.toByteArray(pdfStream))) {
|
||||||
PDDocument doc = Loader.loadPDF(IOUtils.toByteArray(pdfStream));
|
|
||||||
// PDDocumentInformation info = doc.getDocumentInformation();
|
// PDDocumentInformation info = doc.getDocumentInformation();
|
||||||
final PDDocumentNameDictionary names = new PDDocumentNameDictionary(doc.getDocumentCatalog());
|
final PDDocumentNameDictionary names = new PDDocumentNameDictionary(doc.getDocumentCatalog());
|
||||||
//start
|
//start
|
||||||
|
|||||||
@@ -17,8 +17,7 @@ public class ResourceCase extends TestCase {
|
|||||||
private static final Logger LOGGER = LoggerFactory.getLogger(ResourceCase.class.getCanonicalName()); // log output is
|
private static final Logger LOGGER = LoggerFactory.getLogger(ResourceCase.class.getCanonicalName()); // log output is
|
||||||
|
|
||||||
public static File getResourceAsFile(String resourcePath) {
|
public static File getResourceAsFile(String resourcePath) {
|
||||||
try {
|
try(InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath)) {
|
||||||
InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath);
|
|
||||||
if (in == null) {
|
if (in == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -42,8 +41,7 @@ public class ResourceCase extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static byte[] getResourceAsByteArray(String resourcePath) {
|
public static byte[] getResourceAsByteArray(String resourcePath) {
|
||||||
try {
|
try(InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath)) {
|
||||||
InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath);
|
|
||||||
if (in == null) {
|
if (in == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user