From 11b5950be66bcc9d6f0bb28d3fc9d211bc70f4d9 Mon Sep 17 00:00:00 2001 From: tknall Date: Tue, 16 Mar 2010 12:07:29 +0000 Subject: Catching OutOfMemory exceptions, returning appropriate error message/code Binary signature: bug concerning indirect pdf objects fixed SignaturePositioning improved (Signature position can be declared by String which is parsed) Some more error codes (Out of memory, Invalid signature position) iText utility for creation of pdf files added ConfigUtils updated (destination of configuration to be extracted can now be chosen) PDFASUtils updated (more tools) WebApplication: Freetext pdf creation implemented WebApplication: XSS security updates git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@580 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java') diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java index 317e7a4..b343bc6 100644 --- a/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java +++ b/src/main/java/at/knowcenter/wag/egov/egiz/pdf/TablePos.java @@ -18,6 +18,8 @@ package at.knowcenter.wag.egov.egiz.pdf; import java.io.Serializable; + +import at.gv.egiz.pdfas.exceptions.ErrorCode; import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException; /** @@ -153,12 +155,12 @@ public class TablePos implements Serializable String[] cmd_kv = cmd_kvstring.split(":"); if (cmd_kv.length != 2) { - throw new PDFDocumentException(224, "Pos string (=" + pos_string + ") is invalid."); + throw new PDFDocumentException(ErrorCode.INVALID_SIGNATURE_POSITION, "Pos string (=" + pos_string + ") is invalid."); } String cmdstr = cmd_kv[0]; if (cmdstr.length() != 1) { - throw new PDFDocumentException(224, "Pos string (=" + pos_string + ") is invalid."); + throw new PDFDocumentException(ErrorCode.INVALID_SIGNATURE_POSITION, "Pos string (=" + pos_string + ") is invalid."); } char command = cmdstr.charAt(0); String commandval= cmd_kv[1]; @@ -227,13 +229,13 @@ public class TablePos implements Serializable float flval=Float.parseFloat(commandval); if (flval<0) { - throw new PDFDocumentException(224, "Pos string (=" + pos_string + ") is invalid."); + throw new PDFDocumentException(ErrorCode.INVALID_SIGNATURE_POSITION, "Pos string (=" + pos_string + ") is invalid."); } this.footer_line = flval; break; } default : { - throw new PDFDocumentException(224, "Pos string (=" + pos_string + ") is invalid."); + throw new PDFDocumentException(ErrorCode.INVALID_SIGNATURE_POSITION, "Pos string (=" + pos_string + ") is invalid."); } } } @@ -241,7 +243,7 @@ public class TablePos implements Serializable } catch (NumberFormatException e) { - throw new PDFDocumentException(224, "Pos string (=" + pos_string + ") cannot be parsed."); + throw new PDFDocumentException(ErrorCode.INVALID_SIGNATURE_POSITION, "Pos string (=" + pos_string + ") cannot be parsed."); } } public String toString() -- cgit v1.2.3