/[classpath]/inetlib/source/gnu/inet/imap/IMAPConnection.java
ViewVC logotype

Diff of /inetlib/source/gnu/inet/imap/IMAPConnection.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by dog, Thu Oct 23 16:37:27 2003 UTC revision 1.4 by dog, Mon Nov 17 17:41:31 2003 UTC
# Line 407  public class IMAPConnection implements I Line 407  public class IMAPConnection implements I
407        this.out = new CRLFOutputStream(out);        this.out = new CRLFOutputStream(out);
408        return true;        return true;
409      }      }
410      catch(ClassNotFoundException e)      catch (RuntimeException e)
411      {      {
412        return false;             // No javax.net classes in runtime        return false;             // No javax.net classes in runtime
413      }      }
# Line 443  public class IMAPConnection implements I Line 443  public class IMAPConnection implements I
443    {    {
444      try      try
445      {      {
446        String[]m = new String[]        String[] m = new String[] { mechanism };
       {  
       mechanism};  
447        CallbackHandler ch = new SaslCallbackHandler(username, password);        CallbackHandler ch = new SaslCallbackHandler(username, password);
448        // Avoid lengthy callback procedure for GNU Crypto        // Avoid lengthy callback procedure for GNU Crypto
449        Properties p = new Properties();        Properties p = new Properties();
# Line 461  public class IMAPConnection implements I Line 459  public class IMAPConnection implements I
459        if (sasl.hasInitialResponse())        if (sasl.hasInitialResponse())
460        {        {
461          cmd.append(' ');          cmd.append(' ');
462          byte[]init = sasl.evaluateChallenge(new byte[0]);          byte[] init = sasl.evaluateChallenge(new byte[0]);
463          cmd.append(new String(init, US_ASCII));          cmd.append(new String(init, US_ASCII));
464        }        }
465        String tag = newTag();        String tag = newTag();
# Line 499  public class IMAPConnection implements I Line 497  public class IMAPConnection implements I
497          {          {
498            try            try
499            {            {
500              byte[]c0 = response.getText().getBytes(US_ASCII);              byte[] c0 = response.getText().getBytes(US_ASCII);
501              byte[]c1 = BASE64.decode(c0);       // challenge              byte[] c1 = BASE64.decode(c0);       // challenge
502              byte[]r0 = sasl.evaluateChallenge(c1);              byte[] r0 = sasl.evaluateChallenge(c1);
503              byte[]r1 = BASE64.encode(r0);       // response              byte[] r1 = BASE64.encode(r0);       // response
504              out.write(r1);              out.write(r1);
505              out.writeln();              out.writeln();
506              out.flush();              out.flush();
# Line 519  public class IMAPConnection implements I Line 517  public class IMAPConnection implements I
517            asyncResponses.add(response);            asyncResponses.add(response);
518        }        }
519      }      }
520      catch(SaslException e)      catch (SaslException e)
521      {      {
522        return false;             // No provider for mechanism        return false;             // No provider for mechanism
523      }      }
524      catch(ClassNotFoundException e)      catch (RuntimeException e)
525      {      {
526        return false;             // No javax.security.sasl classes        return false;             // No javax.security.sasl classes
527      }      }
# Line 940  public class IMAPConnection implements I Line 938  public class IMAPConnection implements I
938          processAlerts(response);          processAlerts(response);
939          if (id == OK)          if (id == OK)
940          {          {
941            ListEntry[]entries = new ListEntry[acc.size()];            ListEntry[] entries = new ListEntry[acc.size()];
942            acc.toArray(entries);            acc.toArray(entries);
943            return entries;            return entries;
944          }          }
# Line 955  public class IMAPConnection implements I Line 953  public class IMAPConnection implements I
953    /**    /**
954     * Requests the status of the specified mailbox.     * Requests the status of the specified mailbox.
955     */     */
956    public MailboxStatus status(String mailbox, String[]statusNames)    public MailboxStatus status(String mailbox, String[] statusNames)
957      throws IOException      throws IOException
958    {    {
959      String tag = newTag();      String tag = newTag();
# Line 1029  public class IMAPConnection implements I Line 1027  public class IMAPConnection implements I
1027     * @param content the message body (including headers)     * @param content the message body (including headers)
1028     * @return true if successful, false if error in flags/text     * @return true if successful, false if error in flags/text
1029     */     */
1030    public boolean append(String mailbox, String[]flags, byte[]content)    public boolean append(String mailbox, String[] flags, byte[] content)
1031      throws IOException      throws IOException
1032    {    {
1033      String tag = newTag();      String tag = newTag();
# Line 1140  public class IMAPConnection implements I Line 1138  public class IMAPConnection implements I
1138     * Searches the currently selected mailbox for messages matching the     * Searches the currently selected mailbox for messages matching the
1139     * specified criteria.     * specified criteria.
1140     */     */
1141    public int[] search(String charset, String[]criteria) throws IOException    public int[] search(String charset, String[] criteria) throws IOException
1142    {    {
1143      String tag = newTag();      String tag = newTag();
1144      StringBuffer buffer = new StringBuffer(SEARCH);      StringBuffer buffer = new StringBuffer(SEARCH);
# Line 1209  public class IMAPConnection implements I Line 1207  public class IMAPConnection implements I
1207     * Retrieves data associated with messages in the mailbox.     * Retrieves data associated with messages in the mailbox.
1208     * @param messages the message numbers     * @param messages the message numbers
1209     */     */
1210    public MessageStatus[] fetch(int[]messages, String[]fetchCommands)    public MessageStatus[] fetch(int[] messages, String[] fetchCommands)
1211      throws IOException      throws IOException
1212    {    {
1213      String tag = newTag();      String tag = newTag();
# Line 1253  public class IMAPConnection implements I Line 1251  public class IMAPConnection implements I
1251          processAlerts(response);          processAlerts(response);
1252          if (id == OK)          if (id == OK)
1253          {          {
1254            MessageStatus[]statuses = new MessageStatus[list.size()];            MessageStatus[] statuses = new MessageStatus[list.size()];
1255            list.toArray(statuses);            list.toArray(statuses);
1256            return statuses;            return statuses;
1257          }          }
# Line 1272  public class IMAPConnection implements I Line 1270  public class IMAPConnection implements I
1270     * @param flags message flags to set     * @param flags message flags to set
1271     * @return a list of message-number to current flags     * @return a list of message-number to current flags
1272     */     */
1273    public MessageStatus[] store(int[]messages,    public MessageStatus[] store(int[] messages,
1274                                 String flagCommand,                                 String flagCommand,
1275                                 String[]flags) throws IOException                                 String[] flags) throws IOException
1276    {    {
1277      String tag = newTag();      String tag = newTag();
1278      StringBuffer buffer = new StringBuffer(STORE);      StringBuffer buffer = new StringBuffer(STORE);
# Line 1328  public class IMAPConnection implements I Line 1326  public class IMAPConnection implements I
1326          processAlerts(response);          processAlerts(response);
1327          if (id == OK)          if (id == OK)
1328          {          {
1329            MessageStatus[]mf = new MessageStatus[list.size()];            MessageStatus[] mf = new MessageStatus[list.size()];
1330            list.toArray(mf);            list.toArray(mf);
1331            return mf;            return mf;
1332          }          }
# Line 1345  public class IMAPConnection implements I Line 1343  public class IMAPConnection implements I
1343     * @param messages the message numbers     * @param messages the message numbers
1344     * @param mailbox the destination mailbox     * @param mailbox the destination mailbox
1345     */     */
1346    public boolean copy(int[]messages, String mailbox) throws IOException    public boolean copy(int[] messages, String mailbox) throws IOException
1347    {    {
1348      if (messages == null || messages.length < 1)      if (messages == null || messages.length < 1)
1349        return true;        return true;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26