Remove deprecated dependencies and update Maven POM

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@155 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2008-11-03 16:06:01 +00:00
parent 71664294db
commit 9640e6ddc9
7 changed files with 11 additions and 538 deletions

View File

@ -87,12 +87,9 @@ Section "MainSection" SEC01
File "dist\lib\activation-1.0.2.jar"
File "dist\lib\commons-httpclient-2.0.2.jar"
File "dist\lib\commons-logging-1.0.4.jar"
File "dist\lib\jaxen-1.0-FCS-full.jar"
File "dist\lib\jdom-1.0.jar"
File "dist\lib\jtidy-4aug2000r7-dev.jar"
File "dist\lib\log4j-1.2.8.jar"
File "dist\lib\mail-1.3.2.jar"
File "dist\lib\saxpath-1.0-FCS.jar"
File "dist\lib\slide-webdavlib-2.1.jar"
File "dist\lib\swt-3.3-win32-x86.jar"
WriteRegStr HKEY_CURRENT_USER "Software\Microsoft\Windows\CurrentVersion\Run" "DavMail" "$INSTDIR\davmail.exe"
@ -149,12 +146,9 @@ no_quest:
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\lib\swt-3.3-win32-x86.jar"
Delete "$INSTDIR\lib\slide-webdavlib-2.1.jar"
Delete "$INSTDIR\lib\saxpath-1.0-FCS.jar"
Delete "$INSTDIR\lib\mail-1.3.2.jar"
Delete "$INSTDIR\lib\log4j-1.2.8.jar"
Delete "$INSTDIR\lib\jtidy-4aug2000r7-dev.jar"
Delete "$INSTDIR\lib\jdom-1.0.jar"
Delete "$INSTDIR\lib\jaxen-1.0-FCS-full.jar"
Delete "$INSTDIR\lib\commons-logging-1.0.4.jar"
Delete "$INSTDIR\lib\commons-httpclient-2.0.2.jar"
Delete "$INSTDIR\lib\activation-1.0.2.jar"

Binary file not shown.

Binary file not shown.

Binary file not shown.

38
pom.xml
View File

@ -75,17 +75,18 @@
<groupId>slide</groupId>
<artifactId>slide-webdavlib</artifactId>
<version>2.1</version>
<exclusions>
<exclusion>
<groupId>de.zeigermann.xml</groupId>
<artifactId>xml-im-exporter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.8</version>
</dependency>
<dependency>
<groupId>jtidy</groupId>
<artifactId>jtidy</artifactId>
<version>4aug2000r7-dev</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
@ -94,7 +95,7 @@
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
<version>1.1</version>
</dependency>
<dependency>
<groupId>swt</groupId>
@ -114,15 +115,15 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<site>
<id>website</id>
<id>sourceforge.net</id>
<url>scp://web.sourceforge.net/home/groups/d/da/davmail/htdocs</url>
</site>
</distributionManagement>
@ -157,27 +158,10 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>1.0-beta-1</version>
<version>1.2</version>
<configuration>
<!-- High|Normal|Low|Exp|Ignore -->
<threshold>Normal</threshold>
<!-- Min|Default|Max -->
<effort>Default</effort>
<excludeFilterFile>
findbugs-exclude.xml
</excludeFilterFile>
<includeFilterFile>
findbugs-include.xml
</includeFilterFile>
<visitors>
FindDeadLocalStores,UnreadFields
</visitors>
<omitVisitors>
FindDeadLocalStores,UnreadFields
</omitVisitors>
<pluginList>
/libs/fb-contrib/fb-contrib-2.8.0.jar
</pluginList>
</configuration>
</plugin>
<plugin>

View File

@ -1,366 +0,0 @@
package davmail.exchange;
// Imports
import java.io.OutputStream;
import java.io.FilterOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
/**
* Encodes the input data using the BASE64 transformation as specified in
* <A HREF="http://www.faqs.org/rfcs/rfc2045.html">RFC 2045</A>, section
* 6.8, and outputs the encoded data to the underlying
* <code>OutputStream</code>.
*
* @author David A. Herman
* @version 1.0 of September 2000
* @see java.io.FilterOutputStream
*/
public class BASE64EncoderStream extends FilterOutputStream {
/**
* Useful constant representing the default maximum number of output
* characters per line (76).
*/
public static final int LINE_LENGTH = 76;
/**
* The BASE64 alphabet.
*/
private static final byte[] alphabet;
/**
* Fills the BASE64 alphabet table with the ASCII byte values of
* the characters.
**/
static {
try {
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".getBytes("US-ASCII");
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException("ASCII character encoding not supported.");
}
}
/**
* The internal buffer of encoded output bytes.
*/
private final byte[] output = new byte[4];
/**
* The internal buffer of input bytes to be encoded.
*/
private byte[] input = new byte[3];
/**
* The index of the next position in the internal buffer of input bytes
* at which to store input.
*/
private int inputIndex = 0;
/**
* The number of characters that have been output on the current line.
*/
private int chars = 0;
/**
* The maximum number of characters to output per line.
*/
private final int maxLineLength;
/**
* The index into the BASE64 alphabet to generate the next encoded
* character of output data. This index is generated as input data comes
* in, sometimes requiring more than one byte of input before it is
* completely calculated, so it is shared in the object.
*/
private int index;
/**
* Builds a BASE64 encoding stream on top of the given underlying output
* stream, with the default maximum number of characters per line.
*
* @param out output stream
*/
public BASE64EncoderStream(OutputStream out) {
this(out, LINE_LENGTH);
}
/**
* Builds a BASE64 encoding stream on top of the given underlying output
* stream, with the specified maximum number of characters per line. For
* For every <code>max</code> characters that are output to the
* underlying stream, a CRLF sequence (<code>'\r'</code>,
* <code>'\n'</code>) is written.
*
* @param out the underlying output stream.
* @param max the maximum number of output bytes per line.
*/
public BASE64EncoderStream(OutputStream out, int max) {
super(out);
maxLineLength = max;
}
public void flush() throws IOException {
pad();
out.flush();
}
/**
* Completes the encoding of data, padding the input data if necessary
* to end the input on a multiple of 4 bytes, writes a terminating
* CRLF sequence (<code>'\r'</code>, <code>'\n'</code>) to the
* underlying output stream, and closes the underlying output stream.
*
* @throws IOException if an I/O error occurs.
*/
public void close() throws IOException {
try {
flush();
} catch (IOException ignored) {
// ignore
}
// Add a terminating CRLF sequence.
out.write('\r');
out.write('\n');
// Close the underlying output stream.
out.close();
}
/**
* Encodes the given byte array, to be written to the underlying output
* stream.
*
* @param b the byte array to be encoded.
* @throws IOException if an I/O error occurs.
*/
public void write(byte b[]) throws IOException {
write(b, 0, b.length);
}
/**
* Encodes <code>len</code> bytes from the given byte array starting
* at offset <code>off</code>, to be written to the underlying output
* stream.
*
* @param b the byte array to be encoded.
* @param off the offset at which to start reading from the byte array.
* @param len the number of bytes to read.
* @throws IOException if an I/O error occurs.
*/
public void write(byte b[], int off, int len) throws IOException {
for (int i = 0; i < len; i++) {
write(b[off + i]);
}
}
/**
* Encodes the 8 low-order bits of the given integer, to be written to
* the underlying output stream. The 24 high-order bits are discarded.
* If the internal buffer of encoded data is filled upon appending the
* encoded data to it, the buffer is written to the underlying output
* stream.
*
* @param b the integer whose low-order byte is to be encoded.
* @throws IOException if an I/O error occurs.
*/
public void write(int b) throws IOException {
switch (inputIndex) {
case 0:
// The first output character generates its
// index from the first six bits of the first byte.
//
// Input: XXXXXXoo oooooooo oooooooo
// Mask: 11111100 &
// ----------------------------
// Output: 00 XXXXXX
input[0] = (byte) (b & 0xFF);
index = ((input[0] & 0xFC) >> 2);
output[0] = alphabet[index];
// Pre-calculate the first two bits of the
// second output character. If this turns out
// to be the last byte of input, then it will
// already be padded with zeroes, and the rest
// can be padded with '=' characters.
index = ((input[0] & 0x03) << 4);
break;
case 1:
// The second output character generates its
// index from the last two bits of the first
// byte and the first four bits of the second.
//
// Input: ooooooXX YYYYoooo oooooooo
// Mask: 00000011 11110000 &
// ----------------------------
// Output: 00 XX YYYY
input[1] = (byte) (b & 0xFF);
// The first two bits of the second output character
// have already been calculated and stored in the
// member variable 'index'. Add the last four bits
// to the index and generate the output character.
index += ((input[1] & 0xF0) >> 4);
output[1] = alphabet[index];
// Pre-calculate the first four bits of the
// third output character. If this turns out
// to be the last byte of input, then it will
// already be padded with zeroes, and the rest
// can be padded with '=' characters.
index = ((input[1] & 0x0F) << 2);
break;
case 2:
// The third output character generates its
// index from the last four bits of the second
// byte and the first two bits of the third.
//
// Input: oooooooo ooooXXXX YYoooooo
// Mask: 00001111 11000000 &
// ----------------------------
// Output: 00 XXXX YY
input[2] = (byte) (b & 0xFF);
// The first four bits of the third output character
// have already been calculated and stored in the
// member variable 'index'. Add the last two bits
// to the index and generate the output character.
index += ((input[2] & 0xC0) >> 6);
output[2] = alphabet[index];
// The fourth output character generates its
// index from the last six bits of the third byte.
//
// Input: oooooooo oooooooo ooXXXXXX
// Mask: 00111111 &
// ----------------------------
// Output: 00 XXXXXX
index = (b & 0x3F);
output[3] = alphabet[index];
break;
}
inputIndex = ((inputIndex + 1) % 3);
// If the internal buffer is filled, write its contents to the
// underlying output stream.
if (inputIndex == 0) {
writeOutput();
}
}
/**
* Writes the internal buffer of encoded output bytes to the underlying
* output stream. This method is called whenever the 4-byte internal
* buffer is filled.
*
* @throws IOException if an I/O error occurs.
*/
private void writeOutput() throws IOException {
int newchars = (chars + 4) % maxLineLength;
if (newchars == 0) {
out.write(output);
out.write('\r');
out.write('\n');
} else if (newchars < chars) {
out.write(output, 0, 4 - newchars);
out.write('\r');
out.write('\n');
out.write(output, 4 - newchars, newchars);
} else
out.write(output);
chars = newchars;
}
/**
* Pads the encoded data to a multiple of 4 bytes, if necessary. Since
* BASE64 encodes every 3 bytes as 4 bytes of text, if the input is not
* a multiple of 3, the end of the input data must be padded in order
* to send a final quantum of 4 bytes. The BASE64 special character
* <code>'='</code> is used for this purpose. See
* <A HREF="http://www.faqs.org/rfcs/rfc2045.html">RFC 2045</A>, section
* 6.8, for more information.
*
* @throws IOException if an I/O error occurs.
*/
private void pad() throws IOException {
// If the input index is 0, then we ended on a multiple of 3 bytes
// of input, so no padding is necessary.
if (inputIndex > 0) {
// If the input index is 1, then the input text is equivalent
// to 1 modulus 3 bytes, so two input bytes need to be padded.
// We pad the final two output bytes as '=' characters.
if (inputIndex == 1) {
output[1] = alphabet[index];
output[2] = alphabet[64];
output[3] = alphabet[64];
}
// If the input index is 2, then the input text is equivalent
// to 2 modulus 3 bytes, so one input byte needs to be padded.
// We pad the final output byte as a '=' character.
else if (inputIndex == 2) {
output[2] = alphabet[index];
output[3] = alphabet[64];
}
// This is unnecessary, but just for the sake of clarity.
inputIndex = 0;
writeOutput();
}
}
public static byte[] encode(byte[] bytes) {
// Note: This is a public method on Sun's implementation
// and so it should be supported for compatibility.
// Also this method is used by the "B" encoding for now.
// This implementation usesthe encoding stream to
// process the bytes. Possibly, the BASE64 encoding
// stream should use this method for it's encoding.
// Variables
ByteArrayOutputStream byteStream;
BASE64EncoderStream encoder = null;
// Create Streams
byteStream = new ByteArrayOutputStream();
try {
encoder = new BASE64EncoderStream(byteStream);
// Write Bytes
encoder.write(bytes);
encoder.flush();
} catch (IOException e) {
// ignore
} finally {
try {
if (encoder != null) {
encoder.close();
}
} catch (IOException e) {
// ignore
}
}
// Return Encoded Byte Array
return byteStream.toByteArray();
} // encode()
}

View File

@ -1,139 +0,0 @@
package davmail.exchange;
import java.io.*;
import java.util.List;
import org.jdom.*;
import org.jdom.input.SAXBuilder;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
import org.jdom.xpath.XPath;
public class XmlDocument {
private Document document;
public String getAttribute(String xpath) {
String result = null;
try {
XPath xpathExpr = XPath.newInstance(xpath);
Attribute attribute = (Attribute) xpathExpr.selectSingleNode(
document);
if (attribute != null) {
result = attribute.getValue();
}
} catch (JDOMException ex) {
// TODO handle exception
}
return result;
}
public String getValue(String xpath) {
String result = null;
try {
XPath xpathExpr = XPath.newInstance(xpath);
Element element = (Element) xpathExpr.selectSingleNode(document);
if (element != null) {
result = element.getText();
}
} catch (JDOMException ex) {
// TODO handle exception
}
return result;
}
public String getXmlValue(String xpath) {
String result = null;
try {
XPath xpathExpr = XPath.newInstance(xpath);
Element element = (Element) xpathExpr.selectSingleNode(document);
if (element != null) {
XMLOutputter outputter = new XMLOutputter();
StringWriter xmlWriter = new StringWriter();
outputter.output(element, xmlWriter);
result = xmlWriter.toString();
}
} catch (IOException ex) {
// TODO handle exception
} catch (JDOMException ex) {
// TODO handle exception
}
return result;
}
public List getContent(String xpath) {
List result = null;
XPath xpathExpr;
try {
xpathExpr = XPath.newInstance(xpath);
Element element = (Element) xpathExpr.selectSingleNode(document);
if (element != null) {
result = element.getContent();
}
} catch (JDOMException ex) {
// TODO handle exception
}
return result;
}
public List<Attribute> getNodes(String xpath) {
List<Attribute> result = null;
try {
XPath xpathExpr = XPath.newInstance(xpath);
result = xpathExpr.selectNodes(document);
} catch (JDOMException ex) {
// TODO handle exception
}
return result;
}
public String toString() {
if (document == null) {
return null;
}
StringWriter writer = new StringWriter();
XMLOutputter outputter = new XMLOutputter();
outputter.setFormat(Format.getPrettyFormat());
try {
outputter.output(document, writer);
} catch (IOException ex) {
// TODO : handle exception
}
return writer.toString();
}
public XmlDocument() {
}
public void load(String location) throws JDOMException, IOException {
document = new SAXBuilder().build(location);
}
public void load(InputStream stream, String dtd) throws JDOMException, IOException {
document = new SAXBuilder().build(stream, dtd);
}
public void load(Document value) {
document = value;
}
public String toString(Element element) {
if (document == null) {
return null;
}
StringWriter writer = new StringWriter();
XMLOutputter outputter = new XMLOutputter();
outputter.setFormat(Format.getPrettyFormat());
try {
outputter.output(element, writer);
} catch (IOException ex) {
// TODO: handle Exception
}
return writer.toString();
}
}