From d85cbb74b8fe9c2bcc31a4b55ad17ae889d6b578 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 26 Sep 2013 15:49:26 +0200 Subject: forgotten changes for initial code commit --- .../at/gv/egiz/pdfas/lib/api/ByteArrayDataSource.java | 19 +++++++++++++++++++ .../egiz/pdfas/lib/api/IConfigurationConstants.java | 3 ++- .../java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java | 11 ++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/ByteArrayDataSource.java (limited to 'pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api') diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/ByteArrayDataSource.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/ByteArrayDataSource.java new file mode 100644 index 00000000..72c02b08 --- /dev/null +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/ByteArrayDataSource.java @@ -0,0 +1,19 @@ +package at.gv.egiz.pdfas.lib.api; + +public class ByteArrayDataSource implements IDataSource { + + private byte[] byteData; + + public ByteArrayDataSource(byte[] data) { + this.byteData = data; + } + + public String getMIMEType() { + return "application/pdf"; + } + + public byte[] getByteData() { + return this.byteData; + } + +} diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java index 9a8d773a..59515937 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/IConfigurationConstants.java @@ -6,8 +6,9 @@ public interface IConfigurationConstants { public static final String SIG_OBJECT = "sig_obj"; public static final String TYPE = "type"; - public static final String TABLE = "type"; + public static final String TABLE = "table"; public static final String MAIN = "main"; + public static final String POS = "pos"; public static final String DEFAULT = "default"; public static final String SEPERATOR = "."; diff --git a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java index ae9388eb..444480cf 100644 --- a/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java +++ b/pdf-as-lib/src/main/java/at/gv/egiz/pdfas/lib/api/PdfAsFactory.java @@ -2,8 +2,17 @@ package at.gv.egiz.pdfas.lib.api; import java.io.File; +import org.apache.log4j.PropertyConfigurator; + +import at.gv.egiz.pdfas.lib.impl.PdfAsImpl; + public class PdfAsFactory { + + static { + PropertyConfigurator.configure(ClassLoader.getSystemResourceAsStream("resources/log4j.properties")); + } + public static PdfAs createPdfAs(File configuration) { - return null; + return new PdfAsImpl(configuration); } } -- cgit v1.2.3