当前位置: 首页>>代码示例>>Java>>正文


Java GreenMailUser.getPassword方法代码示例

本文整理汇总了Java中com.icegreen.greenmail.user.GreenMailUser.getPassword方法的典型用法代码示例。如果您正苦于以下问题:Java GreenMailUser.getPassword方法的具体用法?Java GreenMailUser.getPassword怎么用?Java GreenMailUser.getPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.icegreen.greenmail.user.GreenMailUser的用法示例。


在下文中一共展示了GreenMailUser.getPassword方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: listSubscribedMailboxes

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Returns an collection of subscribed mailboxes. To appear in search result mailboxes should have
 * {http://www.alfresco.org/model/imap/1.0}subscribed property specified for user. Method searches
 * subscribed mailboxes under mount points defined for a specific user. Mount points include user's
 * IMAP Virtualised Views and Email Archive Views. This method serves LSUB command of the IMAP protocol.
 * 
 * @param user User making the request
 * @param mailboxPattern String name of a mailbox possible including a wildcard.
 * @return Collection of mailboxes matching the pattern.
 * @throws com.icegreen.greenmail.store.FolderException
 */
public Collection<MailFolder> listSubscribedMailboxes(GreenMailUser user, String mailboxPattern)
        throws FolderException
{
    try
    {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
        return registerMailboxes(imapService.listMailboxes(alfrescoUser, getUnqualifiedMailboxPattern(
                alfrescoUser, mailboxPattern), true));
    }
    catch (Throwable e)
    {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:AlfrescoImapHostManager.java

示例2: renameMailbox

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Renames an existing mailbox. The specified mailbox must already exist, the requested name must not exist
 * already but must be able to be created and the user must have rights to delete the existing mailbox and
 * create a mailbox with the new name. Any inferior hierarchical names must also be renamed. If INBOX is renamed,
 * the contents of INBOX are transferred to a new mailbox with the new name, but INBOX is not deleted.
 * If INBOX has inferior mailbox these are not renamed. This method serves RENAME command of the IMAP
 * protocol. <p/> Method searches mailbox under mount points defined for a specific user. Mount points
 * include user's IMAP Virtualised Views and Email Archive Views.
 * 
 * @param user User making the request.
 * @param oldMailboxName String name of the existing folder
 * @param newMailboxName String target new name
 * @throws com.icegreen.greenmail.store.FolderException if an existing folder with the new name.
 * @throws AlfrescoImapFolderException if user does not have rights to create the new mailbox.
 */
public void renameMailbox(GreenMailUser user, String oldMailboxName, String newMailboxName) throws FolderException, AuthorizationException
{
    try
    {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
        String oldFolderPath = getUnqualifiedMailboxPattern(alfrescoUser,
                oldMailboxName);
        String newFolderpath = getUnqualifiedMailboxPattern(alfrescoUser, newMailboxName);
        imapService.renameMailbox(alfrescoUser, oldFolderPath, newFolderpath);
        if (folderCache != null)
        {
            folderCache.remove(oldFolderPath);
            folderCache.remove(newFolderpath);
        }
    }
    catch (Throwable e)
    {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:37,代码来源:AlfrescoImapHostManager.java

示例3: deleteMailbox

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Deletes an existing MailBox. Specified mailbox must already exist on this server, and the user
 * must have rights to delete it. <p/> This method serves DELETE command of the IMAP protocol.
 * 
 * @param user User making the request.
 * @param mailboxName String name of the target
 * @throws com.icegreen.greenmail.store.FolderException if mailbox has a non-selectable store with children
 */
public void deleteMailbox(GreenMailUser user, String mailboxName) throws FolderException, AuthorizationException
{
    try
    {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
        String folderPath = getUnqualifiedMailboxPattern(alfrescoUser, mailboxName);
        imapService.deleteMailbox(alfrescoUser, folderPath);
        if (folderCache != null)
        {
            folderCache.remove(folderPath);
        }
    }
    catch (Throwable e)
    {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:AlfrescoImapHostManager.java

示例4: getFolder

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Returns a reference to an existing Mailbox. The requested mailbox must already exists on this server and the
 * requesting user must have at least lookup rights. <p/> It is also can be used by to obtain hierarchy delimiter
 * by the LIST command: <p/> C: 2 list "" "" <p/> S: * LIST () "." "" <p/> S: 2 OK LIST completed.
 * <p/>
 * Method searches mailbox under mount points defined for a specific user. Mount points include user's IMAP
 * Virtualised Views and Email Archive Views.
 * 
 * @param user User making the request.
 * @param mailboxName String name of the target.
 * @return an Mailbox reference.
 */
public MailFolder getFolder(GreenMailUser user, String mailboxName)
{
    AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
    String folderPath = getUnqualifiedMailboxPattern(
            alfrescoUser, mailboxName);

    if (folderCache == null)
    {
        registerMailBox(imapService.getOrCreateMailbox(alfrescoUser, mailboxName, true, false));
    }

    AlfrescoImapFolder result = folderCache.get(folderPath);

    // if folder isn't in cache then add it via registerMailBox method
    return result != null ? result : registerMailBox(imapService.getOrCreateMailbox(alfrescoUser, mailboxName, true, false));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:AlfrescoImapHostManager.java

示例5: getConnection

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Get the connection to a mail store
 *
 * @param user     whose mail store should be connected
 * @param protocol protocol used to connect
 * @return
 * @throws MessagingException when unable to connect to the store
 */
private static Store getConnection(GreenMailUser user, String protocol) throws MessagingException {
    Properties props = new Properties();
    Session session = Session.getInstance(props);
    int port;
    if (PROTOCOL_POP3.equals(protocol)) {
        port = 3110;
    } else if (PROTOCOL_IMAP.equals(protocol)) {
        port = 3143;
    } else {
        port = 3025;
        props.put("mail.smtp.auth", "true");
        props.put("mail.transport.protocol", "smtp");
        props.put("mail.smtp.host", "localhost");
        props.put("mail.smtp.port", "3025");
    }
    URLName urlName = new URLName(protocol, BIND_ADDRESS, port, null, user.getLogin(), user.getPassword());
    Store store = session.getStore(urlName);
    store.connect();
    return store;
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:29,代码来源:GreenMailServer.java

示例6: listMailboxes

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Returns an collection of mailboxes. Method searches mailboxes under mount points defined for a specific user.
 * Mount points include user's IMAP Virtualised Views and Email Archive Views. This method serves LIST command
 * of the IMAP protocol.
 * 
 * @param user User making the request
 * @param mailboxPattern String name of a mailbox possible including a wildcard.
 * @return Collection of mailboxes matching the pattern.
 * @throws com.icegreen.greenmail.store.FolderException
 */
public Collection<MailFolder> listMailboxes(GreenMailUser user, String mailboxPattern) throws FolderException
{
    try
    {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
        return registerMailboxes(imapService.listMailboxes(alfrescoUser, getUnqualifiedMailboxPattern(
                alfrescoUser, mailboxPattern), false));
    }
    catch (Throwable e)
    {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:AlfrescoImapHostManager.java

示例7: createMailbox

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Returns a reference to a newly created mailbox. The request should specify a mailbox that does not
 * already exist on this server, that could exist on this server and that the user has rights to create.
 * This method serves CREATE command of the IMAP protocol.
 * 
 * @param user User making the request.
 * @param mailboxName String name of the target
 * @return an Mailbox reference.
 * @throws com.icegreen.greenmail.store.FolderException if mailbox already exists
 * @throws AlfrescoImapFolderException if user does not have rights to create the new mailbox.
 */
public MailFolder createMailbox(GreenMailUser user, String mailboxName) throws AuthorizationException, FolderException
{
    try
    {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
        return registerMailBox(imapService.getOrCreateMailbox(alfrescoUser, getUnqualifiedMailboxPattern(
                alfrescoUser, mailboxName), false, true));
    }
    catch (Throwable e)
    {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:AlfrescoImapHostManager.java

示例8: subscribe

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Subscribes a user to a mailbox. The mailbox must exist locally and the user must have rights to modify it.
 * <p/>
 * This method serves SUBSCRIBE command of the IMAP protocol.
 * 
 * @param user User making the request
 * @param mailbox String representation of a mailbox name.
 */
public void subscribe(GreenMailUser user, String mailbox) throws FolderException
{
    try
    {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
        imapService.subscribe(alfrescoUser, getUnqualifiedMailboxPattern(alfrescoUser, mailbox));
    }
    catch (Throwable e)
    {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:AlfrescoImapHostManager.java

示例9: unsubscribe

import com.icegreen.greenmail.user.GreenMailUser; //导入方法依赖的package包/类
/**
 * Unsubscribes from a given mailbox. <p/> This method serves UNSUBSCRIBE command of the IMAP protocol.
 * 
 * @param user User making the request
 * @param mailbox String representation of a mailbox name.
 */
public void unsubscribe(GreenMailUser user, String mailbox) throws FolderException
{
    try
    {
        AlfrescoImapUser alfrescoUser = new AlfrescoImapUser(user.getEmail(), user.getLogin(), user.getPassword());
        imapService.unsubscribe(alfrescoUser, getUnqualifiedMailboxPattern(alfrescoUser, mailbox));
    }
    catch (Throwable e)
    {
        logger.debug(e.getMessage(), e);
        throw new FolderException(e.getMessage());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:AlfrescoImapHostManager.java


注:本文中的com.icegreen.greenmail.user.GreenMailUser.getPassword方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。