[kaffe] CVS kaffe (dalibor): Resynced with GNU inetlib: LDAP and small fixes

Kaffe CVS cvs-commits at kaffe.org
Mon Sep 13 04:17:53 PDT 2004


PatchSet 5163 
Date: 2004/09/13 11:00:16
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU inetlib: LDAP and small fixes

2004-09-12  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/gnu/inet/ldap/AttributeValues.java,
        libraries/javalib/gnu/inet/ldap/BERConstants.java,
        libraries/javalib/gnu/inet/ldap/BERDecoder.java,
        libraries/javalib/gnu/inet/ldap/BEREncoder.java,
        libraries/javalib/gnu/inet/ldap/BERException.java,
        libraries/javalib/gnu/inet/ldap/LDAPConnection.java,
        libraries/javalib/gnu/inet/ldap/LDAPResult.java,
        libraries/javalib/gnu/inet/ldap/Modification.java,
        libraries/javalib/gnu/inet/ldap/ResultHandler.java:
        New files, taken from GNU inetlib.

        * libraries/javalib/gnu/inet/imap/IMAPConnection.java,
        libraries/javalib/gnu/inet/imap/IMAPConstants.java,
        libraries/javalib/gnu/inet/imap/IMAPException.java,
        libraries/javalib/gnu/inet/imap/IMAPResponse.java,
        libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java,
        libraries/javalib/gnu/inet/imap/ListEntry.java,
        libraries/javalib/gnu/inet/imap/MailboxStatus.java,
        libraries/javalib/gnu/inet/imap/MessageStatus.java,
        libraries/javalib/gnu/inet/imap/Pair.java,
        libraries/javalib/gnu/inet/imap/UTF7imap.java,
        libraries/javalib/gnu/inet/smtp/Parameter.java,
        libraries/javalib/gnu/inet/smtp/ParameterList.java,
        libraries/javalib/gnu/inet/smtp/SMTPConnection.java,
        libraries/javalib/gnu/inet/util/BASE64.java,
        libraries/javalib/gnu/inet/util/CRLFInputStream.java,
        libraries/javalib/gnu/inet/util/CRLFOutputStream.java,
        libraries/javalib/gnu/inet/util/EmptyX509TrustManager.java,
        libraries/javalib/gnu/inet/util/GetLocalHostAction.java,
        libraries/javalib/gnu/inet/util/GetSystemPropertyAction.java,
        libraries/javalib/gnu/inet/util/LineInputStream.java,
        libraries/javalib/gnu/inet/util/Logger.java,
        libraries/javalib/gnu/inet/util/MessageInputStream.java,
        libraries/javalib/gnu/inet/util/MessageOutputStream.java,
        libraries/javalib/gnu/inet/util/SaslCallbackHandler.java,
        libraries/javalib/gnu/inet/util/SaslInputStream.java,
        libraries/javalib/gnu/inet/util/SaslOutputStream.java,
        libraries/javalib/gnu/inet/util/StderrLogger.java:
        Resynced with GNU inetlib.

        * libraries/javalib/Makefile.am,
        libraries/javalib/Makefile.in,
        libraries/javalib/all.files:
        Regenerated.

        2004-09-10  Chris Burdess  <dog at bluezoo.org>

        * imap,Logger.java: More verbose debugging messages.

        2004-09-07  Chris Burdess  <dog at bluezoo.org>
        * smtp: Corrections to ESMTP parameter list string form.

        2004-08-25  Chris Burdess  <dog at bluezoo.org>

        * ldap: Experimental LDAP client.

Members: 
	ChangeLog:1.2718->1.2719 
	libraries/javalib/Makefile.am:1.230->1.231 
	libraries/javalib/Makefile.in:1.308->1.309 
	libraries/javalib/all.files:1.21->1.22 
	libraries/javalib/gnu/inet/imap/IMAPConnection.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/IMAPConstants.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/IMAPException.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/IMAPResponse.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/ListEntry.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/MailboxStatus.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/MessageStatus.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/Pair.java:1.2->1.3 
	libraries/javalib/gnu/inet/imap/UTF7imap.java:1.2->1.3 
	libraries/javalib/gnu/inet/ldap/AttributeValues.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/BERConstants.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/BERDecoder.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/BEREncoder.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/BERException.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/LDAPConnection.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/LDAPResult.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/Modification.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/ldap/ResultHandler.java:INITIAL->1.1 
	libraries/javalib/gnu/inet/smtp/Parameter.java:1.2->1.3 
	libraries/javalib/gnu/inet/smtp/ParameterList.java:1.2->1.3 
	libraries/javalib/gnu/inet/smtp/SMTPConnection.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/BASE64.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/CRLFInputStream.java:1.4->1.5 
	libraries/javalib/gnu/inet/util/CRLFOutputStream.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/EmptyX509TrustManager.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/GetLocalHostAction.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/GetSystemPropertyAction.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/LineInputStream.java:1.4->1.5 
	libraries/javalib/gnu/inet/util/Logger.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/MessageInputStream.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/MessageOutputStream.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/SaslCallbackHandler.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/SaslInputStream.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/SaslOutputStream.java:1.2->1.3 
	libraries/javalib/gnu/inet/util/StderrLogger.java:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2718 kaffe/ChangeLog:1.2719
--- kaffe/ChangeLog:1.2718	Sun Sep 12 16:53:03 2004
+++ kaffe/ChangeLog	Mon Sep 13 11:00:16 2004
@@ -1,5 +1,64 @@
 2004-09-12  Dalibor Topic  <robilad at kaffe.org>
 
+	* libraries/javalib/gnu/inet/ldap/AttributeValues.java,
+	libraries/javalib/gnu/inet/ldap/BERConstants.java,
+	libraries/javalib/gnu/inet/ldap/BERDecoder.java,
+	libraries/javalib/gnu/inet/ldap/BEREncoder.java,
+	libraries/javalib/gnu/inet/ldap/BERException.java,
+	libraries/javalib/gnu/inet/ldap/LDAPConnection.java,
+	libraries/javalib/gnu/inet/ldap/LDAPResult.java,
+	libraries/javalib/gnu/inet/ldap/Modification.java,
+	libraries/javalib/gnu/inet/ldap/ResultHandler.java:
+	New files, taken from GNU inetlib.
+
+	* libraries/javalib/gnu/inet/imap/IMAPConnection.java,
+	libraries/javalib/gnu/inet/imap/IMAPConstants.java,
+	libraries/javalib/gnu/inet/imap/IMAPException.java,
+	libraries/javalib/gnu/inet/imap/IMAPResponse.java,
+	libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java,
+	libraries/javalib/gnu/inet/imap/ListEntry.java,
+	libraries/javalib/gnu/inet/imap/MailboxStatus.java,
+	libraries/javalib/gnu/inet/imap/MessageStatus.java,
+	libraries/javalib/gnu/inet/imap/Pair.java,
+	libraries/javalib/gnu/inet/imap/UTF7imap.java,
+	libraries/javalib/gnu/inet/smtp/Parameter.java,
+	libraries/javalib/gnu/inet/smtp/ParameterList.java,
+	libraries/javalib/gnu/inet/smtp/SMTPConnection.java,
+	libraries/javalib/gnu/inet/util/BASE64.java,
+	libraries/javalib/gnu/inet/util/CRLFInputStream.java,
+	libraries/javalib/gnu/inet/util/CRLFOutputStream.java,
+	libraries/javalib/gnu/inet/util/EmptyX509TrustManager.java,
+	libraries/javalib/gnu/inet/util/GetLocalHostAction.java,
+	libraries/javalib/gnu/inet/util/GetSystemPropertyAction.java,
+	libraries/javalib/gnu/inet/util/LineInputStream.java,
+	libraries/javalib/gnu/inet/util/Logger.java,
+	libraries/javalib/gnu/inet/util/MessageInputStream.java,
+	libraries/javalib/gnu/inet/util/MessageOutputStream.java,
+	libraries/javalib/gnu/inet/util/SaslCallbackHandler.java,
+	libraries/javalib/gnu/inet/util/SaslInputStream.java,
+	libraries/javalib/gnu/inet/util/SaslOutputStream.java,
+	libraries/javalib/gnu/inet/util/StderrLogger.java:
+	Resynced with GNU inetlib.
+
+	* libraries/javalib/Makefile.am,
+	libraries/javalib/Makefile.in,
+	libraries/javalib/all.files:
+	Regenerated.
+
+	2004-09-10  Chris Burdess  <dog at bluezoo.org>
+
+        * imap,Logger.java: More verbose debugging messages.
+
+	2004-09-07  Chris Burdess  <dog at bluezoo.org>
+
+        * smtp: Corrections to ESMTP parameter list string form.
+
+	2004-08-25  Chris Burdess  <dog at bluezoo.org>
+
+        * ldap: Experimental LDAP client.
+
+2004-09-12  Dalibor Topic  <robilad at kaffe.org>
+
 	* libraries/javalib/java/awt/MenuComponent.java,
 	libraries/javalib/java/awt/Component.java,
 	libraries/javalib/java/awt/MenuBar.java,
Index: kaffe/libraries/javalib/Makefile.am
diff -u kaffe/libraries/javalib/Makefile.am:1.230 kaffe/libraries/javalib/Makefile.am:1.231
--- kaffe/libraries/javalib/Makefile.am:1.230	Sun Sep 12 15:10:54 2004
+++ kaffe/libraries/javalib/Makefile.am	Mon Sep 13 11:00:20 2004
@@ -99,6 +99,7 @@
 	$(gnu_inet_http_event_SRCS) \
 	$(gnu_inet_https_SRCS) \
 	$(gnu_inet_imap_SRCS) \
+	$(gnu_inet_ldap_SRCS) \
 	$(gnu_inet_nntp_SRCS) \
 	$(gnu_inet_pop3_SRCS) \
 	$(gnu_inet_smtp_SRCS) \
@@ -837,6 +838,16 @@
 	gnu/inet/imap/MessageStatus.java \
 	gnu/inet/imap/Pair.java \
 	gnu/inet/imap/UTF7imap.java
+gnu_inet_ldap_SRCS = \
+	gnu/inet/ldap/AttributeValues.java \
+	gnu/inet/ldap/BERConstants.java \
+	gnu/inet/ldap/BERDecoder.java \
+	gnu/inet/ldap/BEREncoder.java \
+	gnu/inet/ldap/BERException.java \
+	gnu/inet/ldap/LDAPConnection.java \
+	gnu/inet/ldap/LDAPResult.java \
+	gnu/inet/ldap/Modification.java \
+	gnu/inet/ldap/ResultHandler.java
 gnu_inet_nntp_SRCS = \
 	gnu/inet/nntp/ActiveTime.java \
 	gnu/inet/nntp/ActiveTimesIterator.java \
Index: kaffe/libraries/javalib/Makefile.in
diff -u kaffe/libraries/javalib/Makefile.in:1.308 kaffe/libraries/javalib/Makefile.in:1.309
--- kaffe/libraries/javalib/Makefile.in:1.308	Sun Sep 12 15:10:56 2004
+++ kaffe/libraries/javalib/Makefile.in	Mon Sep 13 11:00:23 2004
@@ -440,6 +440,7 @@
 	$(gnu_inet_http_event_SRCS) \
 	$(gnu_inet_https_SRCS) \
 	$(gnu_inet_imap_SRCS) \
+	$(gnu_inet_ldap_SRCS) \
 	$(gnu_inet_nntp_SRCS) \
 	$(gnu_inet_pop3_SRCS) \
 	$(gnu_inet_smtp_SRCS) \
@@ -1232,6 +1233,17 @@
 	gnu/inet/imap/MessageStatus.java \
 	gnu/inet/imap/Pair.java \
 	gnu/inet/imap/UTF7imap.java
+
+gnu_inet_ldap_SRCS = \
+	gnu/inet/ldap/AttributeValues.java \
+	gnu/inet/ldap/BERConstants.java \
+	gnu/inet/ldap/BERDecoder.java \
+	gnu/inet/ldap/BEREncoder.java \
+	gnu/inet/ldap/BERException.java \
+	gnu/inet/ldap/LDAPConnection.java \
+	gnu/inet/ldap/LDAPResult.java \
+	gnu/inet/ldap/Modification.java \
+	gnu/inet/ldap/ResultHandler.java
 
 gnu_inet_nntp_SRCS = \
 	gnu/inet/nntp/ActiveTime.java \
Index: kaffe/libraries/javalib/all.files
diff -u kaffe/libraries/javalib/all.files:1.21 kaffe/libraries/javalib/all.files:1.22
--- kaffe/libraries/javalib/all.files:1.21	Sun Sep 12 15:10:56 2004
+++ kaffe/libraries/javalib/all.files	Mon Sep 13 11:00:25 2004
@@ -477,6 +477,15 @@
 gnu/inet/imap/MessageStatus.java
 gnu/inet/imap/Pair.java
 gnu/inet/imap/UTF7imap.java
+gnu/inet/ldap/AttributeValues.java
+gnu/inet/ldap/BERConstants.java
+gnu/inet/ldap/BERDecoder.java
+gnu/inet/ldap/BEREncoder.java
+gnu/inet/ldap/BERException.java
+gnu/inet/ldap/LDAPConnection.java
+gnu/inet/ldap/LDAPResult.java
+gnu/inet/ldap/Modification.java
+gnu/inet/ldap/ResultHandler.java
 gnu/inet/nntp/ActiveTime.java
 gnu/inet/nntp/ActiveTimesIterator.java
 gnu/inet/nntp/ArticleNumberIterator.java
Index: kaffe/libraries/javalib/gnu/inet/imap/IMAPConnection.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/IMAPConnection.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/IMAPConnection.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/IMAPConnection.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/IMAPConnection.java	Mon Sep 13 11:00:25 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: IMAPConnection.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: IMAPConnection.java,v 1.3 2004/09/13 11:00:25 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -70,7 +70,7 @@
  * The protocol class implementing IMAP4rev1.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:25 $
  */
 public class IMAPConnection
 implements IMAPConstants
@@ -661,6 +661,11 @@
                                                  getHostName (), p, ch);
         if (sasl == null)
           {
+            if (debug)
+              {
+                Logger logger = Logger.getInstance ();
+                logger.log("imap", mechanism + " not available");
+              }
             return false;
           }
         
@@ -737,10 +742,20 @@
       }
     catch (SaslException e)
       {
+        if (debug)
+          {
+            Logger logger = Logger.getInstance ();
+            logger.error ("imap", e);
+          }
         return false;             // No provider for mechanism
       }
     catch (RuntimeException e)
       {
+        if (debug)
+          {
+            Logger logger = Logger.getInstance ();
+            logger.error ("imap", e);
+          }
         return false;             // No javax.security.sasl classes
       }
   }
Index: kaffe/libraries/javalib/gnu/inet/imap/IMAPConstants.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/IMAPConstants.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/IMAPConstants.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/IMAPConstants.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/IMAPConstants.java	Mon Sep 13 11:00:25 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: IMAPConstants.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: IMAPConstants.java,v 1.3 2004/09/13 11:00:25 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -31,7 +31,7 @@
  * IMAP4rev1 string constants.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:25 $
  */
 public interface IMAPConstants
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/IMAPException.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/IMAPException.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/IMAPException.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/IMAPException.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/IMAPException.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: IMAPException.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: IMAPException.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -33,7 +33,7 @@
  * Exception corresponding to an IMAP4 BAD or NO server response.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public class IMAPException extends IOException
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/IMAPResponse.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/IMAPResponse.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/IMAPResponse.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/IMAPResponse.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/IMAPResponse.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: IMAPResponse.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: IMAPResponse.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -33,7 +33,7 @@
  * An IMAP4rev1 server response.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public class IMAPResponse
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/IMAPResponseTokenizer.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: IMAPResponseTokenizer.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: IMAPResponseTokenizer.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -40,7 +40,7 @@
  * protocol server responses into IMAPResponse tokens.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public class IMAPResponseTokenizer implements IMAPConstants
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/ListEntry.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/ListEntry.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/ListEntry.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/ListEntry.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/ListEntry.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: ListEntry.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: ListEntry.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -33,7 +33,7 @@
  * An item in an IMAP LIST or LSUB response.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public class ListEntry implements IMAPConstants
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/MailboxStatus.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/MailboxStatus.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/MailboxStatus.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/MailboxStatus.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/MailboxStatus.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: MailboxStatus.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: MailboxStatus.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -33,7 +33,7 @@
  * Represents the state of a mailbox.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public class MailboxStatus
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/MessageStatus.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/MessageStatus.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/MessageStatus.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/MessageStatus.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/MessageStatus.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: MessageStatus.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: MessageStatus.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -33,7 +33,7 @@
  * Represents the state of a message.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public final class MessageStatus
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/Pair.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/Pair.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/Pair.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/Pair.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/Pair.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: Pair.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: Pair.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -34,7 +34,7 @@
  * The key is always a String, and the value must be a List.
  *
  * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public final class Pair
 {
Index: kaffe/libraries/javalib/gnu/inet/imap/UTF7imap.java
diff -u kaffe/libraries/javalib/gnu/inet/imap/UTF7imap.java:1.2 kaffe/libraries/javalib/gnu/inet/imap/UTF7imap.java:1.3
--- kaffe/libraries/javalib/gnu/inet/imap/UTF7imap.java:1.2	Mon Aug  9 14:38:08 2004
+++ kaffe/libraries/javalib/gnu/inet/imap/UTF7imap.java	Mon Sep 13 11:00:26 2004
@@ -1,5 +1,5 @@
 /*
- * $Id: UTF7imap.java,v 1.2 2004/08/09 14:38:08 dalibor Exp $
+ * $Id: UTF7imap.java,v 1.3 2004/09/13 11:00:26 dalibor Exp $
  * Copyright (C) 2003 The Free Software Foundation
  * 
  * This file is part of GNU inetlib, a library.
@@ -35,7 +35,7 @@
  * encoding scheme.
  *
  * @author <a href="mailto:dog at gnu.org">Chris Burdess</a>
- * @version $Revision: 1.2 $ $Date: 2004/08/09 14:38:08 $
+ * @version $Revision: 1.3 $ $Date: 2004/09/13 11:00:26 $
  */
 public final class UTF7imap
 {
===================================================================
Checking out kaffe/libraries/javalib/gnu/inet/ldap/AttributeValues.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/inet/ldap/AttributeValues.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/inet/ldap/AttributeValues.java	Mon Sep 13 11:17:52 2004
@@ -0,0 +1,81 @@
+/*
+ * AttributeValues.java
+ * Copyright (C) 2004 The Free Software Foundation
+ * 
+ * This file is part of GNU inetlib, a library.
+ * 
+ * GNU inetlib is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * GNU inetlib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * As a special exception, if you link this library with other files to
+ * produce an executable, this library does not by itself cause the
+ * resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why the
+ * executable file might be covered by the GNU General Public License.
+ */
+
+package gnu.inet.ldap;
+
+import java.util.Set;
+
+/**
+ * An attribute type and set of values to associate with it.
+ *
+ * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
+ */
+public class AttributeValues
+{
+
+  /**
+   * The attribute type.
+   */
+  protected final String type;
+
+  /**
+   * The values to assign.
+   */
+  protected final Set values;
+
+  /**
+   * Constructor.
+   * @param type the attribute type
+   * @param values the values to assign
+   */
+  public AttributeValues (String type, Set values)
+  {
+    if (type == null)
+      {
+        throw new NullPointerException ("type");
+      }
+    this.type = type;
+    this.values = values;
+  }
+  
+  /**
+   * @see #type
+   */
+  public String getType ()
+  {
+    return type;
+  }
+
+  /**
+   * @see #values
+   */
+  public Set getValues ()
+  {
+    return values;
+  }
+  
+}
===================================================================
Checking out kaffe/libraries/javalib/gnu/inet/ldap/BERConstants.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/inet/ldap/BERConstants.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/inet/ldap/BERConstants.java	Mon Sep 13 11:17:52 2004
@@ -0,0 +1,74 @@
+/*
+ * BERConstants.java
+ * Copyright (C) 2004 The Free Software Foundation
+ * 
+ * This file is part of GNU inetlib, a library.
+ * 
+ * GNU inetlib is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * GNU inetlib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * As a special exception, if you link this library with other files to
+ * produce an executable, this library does not by itself cause the
+ * resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why the
+ * executable file might be covered by the GNU General Public License.
+ */
+
+package gnu.inet.ldap;
+
+/**
+ * Constants used in BER encoding and decoding.
+ * Universal types are described in ISO/IEC 8824-1:2003, section 8.4.
+ *
+ * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
+ */
+public interface BERConstants
+{
+
+  /* -- Tag classes -- */
+  public static final int UNIVERSAL = 0x00;
+  public static final int APPLICATION = 0x40; // bit 7
+  public static final int CONTEXT = 0x80; // bit 8
+  public static final int PRIVATE = 0xc0; // bits 7 and 8
+
+  /* -- Universal tags -- */
+  public static final int BOOLEAN = 0x01; // UNIVERSAL 1
+  public static final int INTEGER = 0x02;
+  public static final int BIT_STRING = 0x03;
+  public static final int OCTET_STRING = 0x04;
+  public static final int NULL = 0x05;
+  public static final int OID = 0x06;
+  public static final int DESCRIPTOR = 0x07;
+  public static final int EXTERNAL = 0x08;
+  public static final int REAL = 0x09;
+  public static final int ENUMERATED = 0x0a;
+  public static final int EMBEDDED_PDV = 0x0b;
+  public static final int UTF8_STRING = 0x0c;
+  public static final int RELATIVE_OID = 0x0d;
+  public static final int SEQUENCE = 0x10; // UNIVERSAL 16
+  public static final int SET = 0x11;
+
+  /* -- Application tags -- */
+  public static final int FILTER_PRESENT = 0x87; // APPLICATION 7
+  public static final int FILTER_AND = 0xa0; // APPLICATION 32
+  public static final int FILTER_OR = 0xa1;
+  public static final int FILTER_NOT = 0xa2;
+  public static final int FILTER_EQUAL = 0xa3;
+  public static final int FILTER_SUBSTRING = 0xa4;
+  public static final int FILTER_GREATER = 0xa5;
+  public static final int FILTER_LESS = 0xa6;
+  public static final int FILTER_APPROX = 0xa8;
+  public static final int FILTER_EXTENSIBLE = 0xa9;
+  
+}
===================================================================
Checking out kaffe/libraries/javalib/gnu/inet/ldap/BERDecoder.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/inet/ldap/BERDecoder.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/inet/ldap/BERDecoder.java	Mon Sep 13 11:17:52 2004
@@ -0,0 +1,229 @@
+/*
+ * BERDecoder.java
+ * Copyright (C) 2004 The Free Software Foundation
+ * 
+ * This file is part of GNU inetlib, a library.
+ * 
+ * GNU inetlib is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * GNU inetlib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * As a special exception, if you link this library with other files to
+ * produce an executable, this library does not by itself cause the
+ * resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why the
+ * executable file might be covered by the GNU General Public License.
+ */
+
+package gnu.inet.ldap;
+
+import java.io.UnsupportedEncodingException;
+
+/**
+ * Utility class for decoding BER values.
+ * For each value to be read, the application must call <code>parseType</code>
+ * to return the type of the value, then the specific
+ * <code>parse<i>XXX</i></code> method for the type to return the actual
+ * value, or <code>skip</code> to skip the value.
+ *
+ * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
+ */
+public class BERDecoder
+{
+
+  private byte[] buffer;
+  private int offset;
+  private int type;
+  private int len;
+  private boolean control;
+  private boolean utf8;
+
+  public BERDecoder (byte[] data, boolean utf8)
+  {
+    buffer = data;
+    offset = 0;
+    control = true;
+    this.utf8 = utf8;
+  }
+
+  /**
+   * Returns the type of the current value record.
+   * If there are no more records to read, this method returns -1.
+   */
+  public int parseType ()
+    throws BERException
+  {
+    if (offset >= buffer.length)
+      {
+        return -1;
+      }
+    type = (int) buffer[offset++];
+    len = (int) buffer[offset++];
+    if ((len & 0x80) != 0)
+      {
+        int lsize = len - 0x80;
+        if (lsize > 4)
+          {
+            throw new BERException ("Data too long: " + lsize);
+          }
+        if (buffer.length - offset < lsize)
+          {
+            throw new BERException ("Insufficient data");
+          }
+        len = 0;
+        for (int i = 0; i < lsize; i++)
+          {
+            len = (len << 8) + (((int) buffer[offset++]) & 0xff);
+          }
+        if (buffer.length - offset < len)
+          {
+            throw new BERException ("Insufficient data");
+          }
+      }
+    control = false;
+    return type;
+  }
+
+  public boolean available ()
+  {
+    return (offset < buffer.length);
+  }
+
+  public void skip ()
+  {
+    offset += len;
+    control = true;
+  }
+
+  public boolean parseBoolean ()
+    throws BERException
+  {
+    if (control)
+      {
+        parseType ();
+      }
+    if (type != BERConstants.BOOLEAN)
+      {
+        throw new BERException ("Unexpected type: " + type);
+      }
+    int c = (int) buffer[offset++];
+    control = true;
+    return (c != 0);
+  }
+
+  public int parseInt ()
+    throws BERException
+  {
+    if (control)
+      {
+        parseType ();
+      }
+    if (type != BERConstants.INTEGER && type != BERConstants.ENUMERATED)
+      {
+        throw new BERException ("Unexpected type: " + type);
+      }
+    byte c = buffer[offset++];
+    int val = ((int) c) & 0x7f;
+    for (int i = 1; i < len; i++)
+      {
+        val <<= 0x08;
+        val |= ((int) buffer[offset++]) & 0xff;
+      }
+    if ((c & 0x80) != 0)
+      {
+        val = -val;
+      }
+    control = true;
+    return val;
+  }
+
+  public String parseString ()
+    throws BERException
+  {
+    if (control)
+      {
+        parseType ();
+      }
+    if (len == 0)
+      {
+        control = true;
+        return "";
+      }
+    if (type != BERConstants.UTF8_STRING && type != BERConstants.OCTET_STRING)
+      {
+        throw new BERException ("Unexpected type: " + type);
+      }
+    String encoding = (type == BERConstants.UTF8_STRING) ? "UTF-8" :
+      "ISO-8859-1";
+    try
+      {
+        String ret = new String (buffer, offset, len, encoding);
+        offset += len;
+        control = true;
+        return ret;
+      }
+    catch (UnsupportedEncodingException e)
+      {
+        throw new BERException ("JVM does not support " + encoding);
+      }
+  }
+
+  public byte[] parseOctetString ()
+    throws BERException
+  {
+    if (control)
+      {
+        parseType ();
+      }
+    if (type != BERConstants.OCTET_STRING)
+      {
+        throw new BERException ("Unexpected type: " + type);
+      }
+    byte[] ret = new byte[len];
+    System.arraycopy (buffer, offset, ret, 0, len);
+    offset += len;
+    control = true;
+    return ret;
+  }
+
+  public BERDecoder parseSequence ()
+    throws BERException
+  {
+    return parseSequence (BERConstants.SEQUENCE);
+  }
+  
+  public BERDecoder parseSequence (int code)
+    throws BERException
+  {
+    if (control)
+      {
+        parseType ();
+      }
+    if (code != -1 && type != code)
+      {
+        throw new BERException ("Unexpected type: " + type);
+      }
+    byte[] ret = new byte[len];
+    System.arraycopy (buffer, offset, ret, 0, len);
+    offset += len;
+    control = true;
+    return new BERDecoder (ret, utf8);
+  }
+  
+  public BERDecoder parseSet ()
+    throws BERException
+  {
+    return parseSequence (BERConstants.SET);
+  }
+  
+}
===================================================================
Checking out kaffe/libraries/javalib/gnu/inet/ldap/BEREncoder.java
RCS:  /home/cvs/kaffe/kaffe/libraries/javalib/gnu/inet/ldap/BEREncoder.java,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/libraries/javalib/gnu/inet/ldap/BEREncoder.java	Mon Sep 13 11:17:53 2004
@@ -0,0 +1,528 @@
+/*
+ * BEREncoder.java
+ * Copyright (C) 2004 The Free Software Foundation
+ * 
+ * This file is part of GNU inetlib, a library.
+ * 
+ * GNU inetlib is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * GNU inetlib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * As a special exception, if you link this library with other files to
+ * produce an executable, this library does not by itself cause the
+ * resulting executable to be covered by the GNU General Public License.
+ * This exception does not however invalidate any other reasons why the
+ * executable file might be covered by the GNU General Public License.
+ */
+
+package gnu.inet.ldap;
+
+import java.io.UnsupportedEncodingException;
+
+/**
+ * Utility class to construct BER-encoded data.
+ *
+ * @author <a href='mailto:dog at gnu.org'>Chris Burdess</a>
+ */
+public class BEREncoder
+{
+
+  private byte[] buffer;
+  private int offset;
+  private int[] sequenceOffset;
+  private int sequenceIndex;
+  private boolean utf8;
+
+  /**
+   * Constructor.
+   * @param utf whether to use UTF-8 for encoding strings
+   */
+  public BEREncoder (boolean utf8)
+  {
+    this (utf8, 1024);
+  }
+
+  /**
+   * Constructor.
+   * @param utf whether to use UTF-8 for encoding strings
+   * @param initialSize the initial buffer size
+   */
+  public BEREncoder (boolean utf8, int initialSize)
+  {
+    this.utf8 = utf8;
+    buffer = new byte[initialSize];
+    offset = 0;
+    sequenceOffset = new int[16];
+    sequenceIndex = 0;
+  }
+
+  /**
+   * Reset this encoder for reuse.
+   */
+  public void reset ()
+  {
+    for (int i = 0; i < offset; i++)
+      {
+        buffer[i] = 0;
+      }
+    offset = 0;
+    for (int i = 0; i < sequenceIndex; i++)
+      {
+        sequenceOffset[i] = 0;
+      }
+    sequenceIndex = 0;
+  }
+
+  /**
+   * Returns the current size of the encoded data.
+   */
+  public int size ()
+  {
+    return offset;
+  }
+
+  /**
+   * Returns the encoded data.

*** Patch too long, truncated ***




More information about the kaffe mailing list