1 17 18 package org.apache.james.fetchmail; 19 20 import javax.mail.Session ; 21 22 import org.apache.avalon.framework.configuration.ConfigurationException; 23 24 public class DynamicAccount extends Account 25 { 26 27 38 private DynamicAccount( 39 int sequenceNumber, 40 ParsedConfiguration parsedConfiguration, 41 String user, 42 String password, 43 String recipient, 44 boolean ignoreRecipientHeader, 45 Session session) 46 throws ConfigurationException 47 { 48 super( 49 sequenceNumber, 50 parsedConfiguration, 51 user, 52 password, 53 recipient, 54 ignoreRecipientHeader, 55 session); 56 } 57 58 72 public DynamicAccount( 73 int sequenceNumber, 74 ParsedConfiguration parsedConfiguration, 75 String userName, 76 String userPrefix, 77 String userSuffix, 78 String password, 79 String recipientPrefix, 80 String recipientSuffix, 81 boolean ignoreRecipientHeader, 82 Session session) 83 throws ConfigurationException 84 { 85 this( 86 sequenceNumber, 87 parsedConfiguration, 88 null, 89 password, 90 null, 91 ignoreRecipientHeader, 92 session); 93 94 StringBuffer userBuffer = new StringBuffer (userPrefix); 95 userBuffer.append(userName); 96 userBuffer.append(userSuffix); 97 setUser(userBuffer.toString()); 98 99 StringBuffer recipientBuffer = new StringBuffer (recipientPrefix); 100 recipientBuffer.append(userName); 101 recipientBuffer.append(recipientSuffix); 102 setRecipient(recipientBuffer.toString()); 103 } 104 } 105 | Popular Tags |