EWS: Upgrade woodstox version to use enhanced base64 conversion (reduced memory usage)

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1543 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-11-17 21:28:29 +00:00
parent 6277125a83
commit 5eaaf961de
10 changed files with 21 additions and 14 deletions

View File

@ -98,9 +98,9 @@ Section "MainSection" SEC01
File "dist\lib\mail-1.4.1.jar" File "dist\lib\mail-1.4.1.jar"
File "dist\lib\slf4j-api-1.3.1.jar" File "dist\lib\slf4j-api-1.3.1.jar"
File "dist\lib\slf4j-log4j12-1.3.1.jar" File "dist\lib\slf4j-log4j12-1.3.1.jar"
File "dist\lib\stax-api-1.0.1.jar" File "dist\lib\stax2-api-3.0.3.jar"
File "dist\lib\swt-3.6-win32-x86.jar" File "dist\lib\swt-3.6-win32-x86.jar"
File "dist\lib\wstx-asl-3.2.7.jar" File "dist\lib\woodstox-core-asl-4.0.9.jar"
File "dist\lib\xercesImpl-2.8.1.jar" File "dist\lib\xercesImpl-2.8.1.jar"
WriteRegStr HKEY_CURRENT_USER "Software\Microsoft\Windows\CurrentVersion\Run" "DavMail" "$INSTDIR\davmail.exe" WriteRegStr HKEY_CURRENT_USER "Software\Microsoft\Windows\CurrentVersion\Run" "DavMail" "$INSTDIR\davmail.exe"
@ -169,9 +169,9 @@ no_quest:
Delete "$INSTDIR\lib\mail-1.4.1.jar" Delete "$INSTDIR\lib\mail-1.4.1.jar"
Delete "$INSTDIR\lib\slf4j-api-1.3.1.jar" Delete "$INSTDIR\lib\slf4j-api-1.3.1.jar"
Delete "$INSTDIR\lib\slf4j-log4j12-1.3.1.jar" Delete "$INSTDIR\lib\slf4j-log4j12-1.3.1.jar"
Delete "$INSTDIR\lib\stax-api-1.0.1.jar" Delete "$INSTDIR\lib\stax2-api-3.0.3.jar"
Delete "$INSTDIR\lib\swt-3.6-win32-x86.jar" Delete "$INSTDIR\lib\swt-3.6-win32-x86.jar"
Delete "$INSTDIR\lib\wstx-asl-3.2.7.jar" Delete "$INSTDIR\lib\woodstox-core-asl-4.0.9.jar"
Delete "$INSTDIR\lib\xercesImpl-2.8.1.jar" Delete "$INSTDIR\lib\xercesImpl-2.8.1.jar"
Delete "$INSTDIR\davmailservice.exe" Delete "$INSTDIR\davmailservice.exe"

View File

@ -21,9 +21,9 @@
<classPath>dist/lib/mail-1.4.1.jar</classPath> <classPath>dist/lib/mail-1.4.1.jar</classPath>
<classPath>dist/lib/slf4j-api-1.3.1.jar</classPath> <classPath>dist/lib/slf4j-api-1.3.1.jar</classPath>
<classPath>dist/lib/slf4j-log4j12-1.3.1.jar</classPath> <classPath>dist/lib/slf4j-log4j12-1.3.1.jar</classPath>
<classPath>dist/lib/stax-api-1.0.1.jar</classPath> <classPath>dist/lib/stax2-api-3.0.3.jar</classPath>
<classPath>dist/lib/swt-3.6-win32-x86.jar</classPath> <classPath>dist/lib/swt-3.6-win32-x86.jar</classPath>
<classPath>dist/lib/wstx-asl-3.2.7.jar</classPath> <classPath>dist/lib/woodstox-core-asl-4.0.9.jar</classPath>
<classPath>dist/lib/xercesImpl-2.8.1.jar</classPath> <classPath>dist/lib/xercesImpl-2.8.1.jar</classPath>
<embeddedJar>false</embeddedJar> <embeddedJar>false</embeddedJar>
<executableName>dist/davmail.exe</executableName> <executableName>dist/davmail.exe</executableName>

View File

@ -21,9 +21,9 @@
<classPath>dist/lib/mail-1.4.1.jar</classPath> <classPath>dist/lib/mail-1.4.1.jar</classPath>
<classPath>dist/lib/slf4j-api-1.3.1.jar</classPath> <classPath>dist/lib/slf4j-api-1.3.1.jar</classPath>
<classPath>dist/lib/slf4j-log4j12-1.3.1.jar</classPath> <classPath>dist/lib/slf4j-log4j12-1.3.1.jar</classPath>
<classPath>dist/lib/stax-api-1.0.1.jar</classPath> <classPath>dist/lib/stax2-api-3.0.3.jar</classPath>
<classPath>dist/lib/swt-3.6-win32-x86.jar</classPath> <classPath>dist/lib/swt-3.6-win32-x86.jar</classPath>
<classPath>dist/lib/wstx-asl-3.2.7.jar</classPath> <classPath>dist/lib/woodstox-core-asl-4.0.9.jar</classPath>
<classPath>dist/lib/xercesImpl-2.8.1.jar</classPath> <classPath>dist/lib/xercesImpl-2.8.1.jar</classPath>
<embeddedJar>false</embeddedJar> <embeddedJar>false</embeddedJar>
<executableName>dist/davmailconsole.exe</executableName> <executableName>dist/davmailconsole.exe</executableName>

View File

@ -21,9 +21,9 @@
<classPath>dist/lib/mail-1.4.1.jar</classPath> <classPath>dist/lib/mail-1.4.1.jar</classPath>
<classPath>dist/lib/slf4j-api-1.3.1.jar</classPath> <classPath>dist/lib/slf4j-api-1.3.1.jar</classPath>
<classPath>dist/lib/slf4j-log4j12-1.3.1.jar</classPath> <classPath>dist/lib/slf4j-log4j12-1.3.1.jar</classPath>
<classPath>dist/lib/stax-api-1.0.1.jar</classPath> <classPath>dist/lib/stax2-api-3.0.3.jar</classPath>
<classPath>dist/lib/swt-3.6-win32-x86.jar</classPath> <classPath>dist/lib/swt-3.6-win32-x86.jar</classPath>
<classPath>dist/lib/wstx-asl-3.2.7.jar</classPath> <classPath>dist/lib/woodstox-core-asl-4.0.9.jar</classPath>
<classPath>dist/lib/xercesImpl-2.8.1.jar</classPath> <classPath>dist/lib/xercesImpl-2.8.1.jar</classPath>
<currentDirectory>${EXECUTABLEPATH}</currentDirectory> <currentDirectory>${EXECUTABLEPATH}</currentDirectory>
<embeddedJar>false</embeddedJar> <embeddedJar>false</embeddedJar>

Binary file not shown.

BIN
lib/stax2-api-3.0.3.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -242,8 +242,8 @@
<!-- included in Java 1.6, needed with Java 1.5 --> <!-- included in Java 1.6, needed with Java 1.5 -->
<dependency> <dependency>
<groupId>org.codehaus.woodstox</groupId> <groupId>org.codehaus.woodstox</groupId>
<artifactId>wstx-asl</artifactId> <artifactId>woodstox-core-asl</artifactId>
<version>3.2.7</version> <version>4.0.9</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.samba.jcifs</groupId> <groupId>org.samba.jcifs</groupId>

View File

@ -28,6 +28,7 @@ import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.codehaus.stax2.XMLStreamReader2;
import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamException;
@ -837,8 +838,14 @@ public abstract class EWSMethod extends PostMethod {
protected void handleMimeContent(XMLStreamReader reader, Item responseItem) throws XMLStreamException { protected void handleMimeContent(XMLStreamReader reader, Item responseItem) throws XMLStreamException {
byte[] base64MimeContent = reader.getElementText().getBytes(); if (reader instanceof XMLStreamReader2) {
responseItem.mimeContent = Base64.decodeBase64(base64MimeContent); // Stax2 parser: use enhanced base64 conversion
responseItem.mimeContent = ((XMLStreamReader2) reader).getElementAsBinary();
} else {
// failover: slow and memory consuming conversion
byte[] base64MimeContent = reader.getElementText().getBytes();
responseItem.mimeContent = Base64.decodeBase64(base64MimeContent);
}
} }
protected void addExtendedPropertyValue(XMLStreamReader reader, Item item) throws XMLStreamException { protected void addExtendedPropertyValue(XMLStreamReader reader, Item item) throws XMLStreamException {