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


Java Flag.SEEN属性代码示例

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


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

示例1: getFlags

/**
 * Updates in-memory flags from stored metadata and returns them.
 */
@Override
public Flags getFlags() throws MessagingException {
    super.setFlag(Flag.RECENT, isRecent());
    super.setFlag(Flag.SEEN, !isUnread());
    super.setFlag(Flag.ANSWERED, isReplied());
    super.setFlag(Flag.DELETED, isDeleted());
    return super.getFlags();
}
 
开发者ID:NoYouShutup,项目名称:CryptMeme,代码行数:11,代码来源:Email.java

示例2: getSearchTerm

/**
 * Returns a <pre>{@link SearchTerm}</pre> to be used when retrieving messages.
 * Default term is only for unseen emails, but when retrieveSeenEmails is
 * set to true it returns a union of terms for both unseen and seen messages.
 *
 * @return a search term to be used for message retrieval.
 */
private SearchTerm getSearchTerm() {
    Flags seenFlag = new Flags(Flag.SEEN);
    FlagTerm unseenFlagTerm = new FlagTerm(seenFlag, false);
    if (retrieveSeenEmails) {
        FlagTerm seenFlagTerm = new FlagTerm(seenFlag, true);
        return new OrTerm(unseenFlagTerm, seenFlagTerm);
    }
    return unseenFlagTerm;
}
 
开发者ID:theparanoidtimes,项目名称:tabellarium,代码行数:16,代码来源:ImapMailboxFolderTaskExecutor.java

示例3: setFlag

private void setFlag(NodeRef nodeRef, Flag flag, boolean value)
{
    String permission = (flag == Flag.DELETED ? PermissionService.DELETE_NODE : PermissionService.WRITE_PROPERTIES);
    
    
    AccessStatus status = permissionService.hasPermission(nodeRef, permission);
    if (status == AccessStatus.DENIED)
    {
        if(flag == Flag.DELETED)
        {
            logger.debug("[setFlag] Access denied to set DELETED FLAG:" + nodeRef);
            throw new AccessDeniedException("No permission to set DELETED flag");
        }
        if(flag == Flag.SEEN)
        {
            logger.debug("[setFlag] Access denied to set SEEN FLAG:" + nodeRef);
            //TODO - should we throw an exception here?
            //throw new AccessDeniedException("No permission to set DELETED flag");
        }
        else
        {
           
            logger.debug("[setFlag] Access denied to set flag:" + nodeRef);
            throw new AccessDeniedException("No permission to set flag:" + flag.toString());
        }
    }
    else
    {
        checkForFlaggableAspect(nodeRef);
        policyBehaviourFilter.disableBehaviour(ContentModel.ASPECT_AUDITABLE);
        policyBehaviourFilter.disableBehaviour(ContentModel.ASPECT_VERSIONABLE);
        try
        {                    
            if(logger.isDebugEnabled())
            {
                logger.debug("set flag nodeRef:" + nodeRef + ",flag:" + flagToQname.get(flag) + ", value:" + value);
            }
            nodeService.setProperty(nodeRef, flagToQname.get(flag), value);
            messageCache.remove(nodeRef);
        }
        finally
        {
            policyBehaviourFilter.enableBehaviour(ContentModel.ASPECT_AUDITABLE);
            policyBehaviourFilter.enableBehaviour(ContentModel.ASPECT_VERSIONABLE);                
        }
    }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:47,代码来源:ImapServiceImpl.java


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