• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WellKnownFolderName类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName的典型用法代码示例。如果您正苦于以下问题:Java WellKnownFolderName类的具体用法?Java WellKnownFolderName怎么用?Java WellKnownFolderName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WellKnownFolderName类属于microsoft.exchange.webservices.data.core.enumeration.property包,在下文中一共展示了WellKnownFolderName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: exists

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
@Override
public boolean exists() throws MessagingException {
    if (folder != null) {
        return true;
    }
    try {
        FolderView view = new FolderView(1);
        SearchFilter searchFilter = new SearchFilter.IsEqualTo(FolderSchema.DisplayName, name);
        FindFoldersResults lResult = getService().findFolders(WellKnownFolderName.Inbox, searchFilter, view);
        if (lResult.getTotalCount() > 0) {
            folder = lResult.getFolders().get(0);
            INBOX = Folder.bind(getService(), new FolderId(WellKnownFolderName.Inbox));
            return true;
        } else {
            return false;
        }
    } catch (Exception e) {
        throw new MessagingException(e.getMessage(), e);
    }
}
 
开发者ID:gartcimore,项目名称:javamail4ews,代码行数:21,代码来源:EwsFolder.java


示例2: EwsFolder

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
private EwsFolder(EwsStore store, FolderId pFolderId, FolderId pParentFolderId) {
    super(store);
    addFolderListener(new FolderListenerPublisher());

    ITEM_VIEW_MAX_ITEMS = getConfiguration().getInt(
            "org.sourceforge.net.javamail4ews.store.EwsFolder.ItemViewMaxItems");
    CONFLICT_RESOLUTION_MODE = ConflictResolutionMode.valueOf(getConfiguration().getString(
            "org.sourceforge.net.javamail4ews.store.EwsFolder.ConflictResolutionMode"));
    DELETE_MODE = DeleteMode.valueOf(getConfiguration().getString(
            "org.sourceforge.net.javamail4ews.store.EwsFolder.DeleteMode"));
    prefetchItems = getConfiguration().getBoolean("org.sourceforge.net.javamail4ews.store.EwsFolder.prefetchItems");
    try {
        INBOX = Folder.bind(getService(), new FolderId(WellKnownFolderName.Inbox));

        if (pFolderId != null) {
            folder = Folder.bind(getService(), pFolderId);
            parentFolder = Folder.bind(getService(), folder.getParentFolderId());
        } else if (pParentFolderId != null) {
            parentFolder = Folder.bind(getService(), pParentFolderId);
        } else {
            throw new IllegalArgumentException("pFolderId and pParentFolderId are null!");
        }
    } catch (Exception e) {
        throw new RuntimeException(e.getMessage(), e);
    }
}
 
开发者ID:gartcimore,项目名称:javamail4ews,代码行数:27,代码来源:EwsFolder.java


示例3: createInstance

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
@Override
public Map<Class<?>, Map<String, ExchangeVersion>>
createInstance() {
  Map<Class<?>, Map<String, ExchangeVersion>> enumDicts =
      new HashMap<Class<?>, Map<String,
          ExchangeVersion>>();
  enumDicts.put(WellKnownFolderName.class,
      buildEnumDict(WellKnownFolderName.class));
  enumDicts.put(ItemTraversal.class,
      buildEnumDict(ItemTraversal.class));
  enumDicts.put(FileAsMapping.class,
      buildEnumDict(FileAsMapping.class));
  enumDicts.put(EventType.class,
      buildEnumDict(EventType.class));
  enumDicts.put(MeetingRequestsDeliveryScope.class,
      buildEnumDict(MeetingRequestsDeliveryScope.
          class));
  return enumDicts;
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:20,代码来源:EwsUtilities.java


示例4: createCalendar

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
private CalendarFolder createCalendar(String calendarName) {

        try {
            LOG.info(String.format("Trying to create new calendar with name '%s'", calendarName));

            CalendarFolder folder = new CalendarFolder(exchangeService);
            folder.setDisplayName(calendarName);
            folder.save(WellKnownFolderName.Calendar);

            LOG.info(String.format("New calendar folder '%s' created.", calendarName));

            return CalendarFolder.bind(exchangeService, folder.getId());
        } catch (Exception ex) { // NOSONAR - EWS Java API throws Exception, that's life
            throw new CalendarNotCreatedException(String.format("Exchange calendar '%s' could not be created",
                    calendarName), ex);
        }
    }
 
开发者ID:synyx,项目名称:urlaubsverwaltung,代码行数:18,代码来源:ExchangeCalendarProvider.java


示例5: discover

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
private void discover() {

        try {
            discoverFolders(WellKnownFolderName.Calendar);
        } catch (Exception ex) { // NOSONAR - EWS Java API throws Exception, that's life
            LOG.info(String.format("An error occurred while trying to get calendar folders, cause: %s",
                    ex.getMessage()));

            LOG.info("Trying to discover which folders exist at all...");

            for (WellKnownFolderName folderName : WellKnownFolderName.values()) {
                try {
                    discoverFolders(folderName);
                } catch (Exception e) { // NOSONAR - EWS Java API throws Exception, that's life
                    LOG.info(String.format(
                            "An error occurred while trying to get folders for well known folder name: %s, cause: %s",
                            folderName.name(), ex.getMessage()));
                }
            }
        }
    }
 
开发者ID:synyx,项目名称:urlaubsverwaltung,代码行数:22,代码来源:ExchangeCalendarProvider.java


示例6: discoverFolders

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
private void discoverFolders(WellKnownFolderName wellKnownFolderName) throws Exception { // NOSONAR - EWS Java API throws Exception, that's life

        FindFoldersResults folders = exchangeService.findFolders(wellKnownFolderName,
                new FolderView(Integer.MAX_VALUE));

        for (Folder folder : folders.getFolders()) {
            LOG.info("Found folder: " + wellKnownFolderName.name() + " - " + folder.getDisplayName());
        }
    }
 
开发者ID:synyx,项目名称:urlaubsverwaltung,代码行数:10,代码来源:ExchangeCalendarProvider.java


示例7: sendMessage

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
private void sendMessage(EmailMessage msg) throws Exception {
	if (getConfiguration().getBoolean("org.sourceforge.net.javamail4ews.transport.EwsTransport.SendAndSaveCopy")) {
		msg.sendAndSaveCopy(WellKnownFolderName.SentItems);
	} else {
		msg.send();
	}
}
 
开发者ID:gartcimore,项目名称:javamail4ews,代码行数:8,代码来源:EwsTransport.java


示例8: getFolder

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
@Override
public EwsFolder getFolder(String name) throws MessagingException {
	try {
		return new EwsFolder(this, name, new FolderId(WellKnownFolderName.Inbox));
	} catch (Exception e) {
		throw new MessagingException(e.getMessage(), e);
	}
}
 
开发者ID:gartcimore,项目名称:javamail4ews,代码行数:9,代码来源:EwsStore.java


示例9: add

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Adds a well-known folder to the collection.
 *
 * @param folderName the folder name
 * @return A FolderId encapsulating the specified Id.
 */
public FolderId add(WellKnownFolderName folderName) {
  FolderId folderId = new FolderId(folderName);
  if (this.contains(folderId)) {
    throw new IllegalArgumentException("The ID is already in the list.");
  }
  this.internalAdd(folderId);
  return folderId;
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:15,代码来源:FolderIdCollection.java


示例10: configure

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
public void configure() throws ConfigurationException {
	try {
		exchangeService = new ExchangeService(
				ExchangeVersion.Exchange2010_SP2);
		CredentialFactory cf = new CredentialFactory(getAuthAlias(),
				getUserName(), getPassword());
		ExchangeCredentials credentials = new WebCredentials(
				cf.getUsername(), cf.getPassword());
		exchangeService.setCredentials(credentials);
		if (StringUtils.isNotEmpty(getMailAddress())) {
			exchangeService.autodiscoverUrl(getMailAddress());
		} else {
			exchangeService.setUrl(new URI(getUrl()));
		}

		FolderId inboxId;
		if (StringUtils.isNotEmpty(getMailAddress())) {
			Mailbox mailbox = new Mailbox(getMailAddress());
			inboxId = new FolderId(WellKnownFolderName.Inbox, mailbox);
		} else {
			inboxId = new FolderId(WellKnownFolderName.Inbox);
		}

		FindFoldersResults findFoldersResultsIn;
		FolderView folderViewIn = new FolderView(10);
		if (StringUtils.isNotEmpty(getInputFolder())) {
			SearchFilter searchFilterIn = new SearchFilter.IsEqualTo(
					FolderSchema.DisplayName, getInputFolder());
			findFoldersResultsIn = exchangeService.findFolders(inboxId,
					searchFilterIn, folderViewIn);
			if (findFoldersResultsIn.getTotalCount() == 0) {
				throw new ConfigurationException(
						"no (in) folder found with name ["
								+ getInputFolder() + "]");
			} else if (findFoldersResultsIn.getTotalCount() > 1) {
				throw new ConfigurationException(
						"multiple (in) folders found with name ["
								+ getInputFolder() + "]");
			}
		} else {
			findFoldersResultsIn = exchangeService.findFolders(inboxId,
					folderViewIn);
		}
		folderIn = findFoldersResultsIn.getFolders().get(0);

		if (StringUtils.isNotEmpty(getFilter())) {
			if (!getFilter().equalsIgnoreCase("NDR")) {
				throw new ConfigurationException(
						"illegal value for filter [" + getFilter()
								+ "], must be 'NDR' or empty");
			}
		}

		if (StringUtils.isNotEmpty(getOutputFolder())) {
			SearchFilter searchFilterOut = new SearchFilter.IsEqualTo(
					FolderSchema.DisplayName, getOutputFolder());
			FolderView folderViewOut = new FolderView(10);
			FindFoldersResults findFoldersResultsOut = exchangeService
					.findFolders(inboxId, searchFilterOut, folderViewOut);
			if (findFoldersResultsOut.getTotalCount() == 0) {
				throw new ConfigurationException(
						"no (out) folder found with name ["
								+ getOutputFolder() + "]");
			} else if (findFoldersResultsOut.getTotalCount() > 1) {
				throw new ConfigurationException(
						"multiple (out) folders found with name ["
								+ getOutputFolder() + "]");
			}
			folderOut = findFoldersResultsOut.getFolders().get(0);
		}
	} catch (Exception e) {
		throw new ConfigurationException(e);
	}
}
 
开发者ID:ibissource,项目名称:iaf,代码行数:75,代码来源:ExchangeMailListener.java


示例11: findCalendar

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
private Optional<CalendarFolder> findCalendar(String calendarName) throws Exception { // NOSONAR - EWS Java API throws Exception, that's life

        FindFoldersResults calendarRoot = exchangeService.findFolders(WellKnownFolderName.Calendar,
                new FolderView(Integer.MAX_VALUE));

        for (Folder folder : calendarRoot.getFolders()) {
            if (folder.getDisplayName().equals(calendarName)) {
                return Optional.of((CalendarFolder) folder);
            }
        }

        return Optional.empty();
    }
 
开发者ID:synyx,项目名称:urlaubsverwaltung,代码行数:14,代码来源:ExchangeCalendarProvider.java


示例12: getDefaultFolder

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
@Override
public EwsFolder getDefaultFolder() throws MessagingException {
	return new EwsFolder(this, new FolderId(WellKnownFolderName.Inbox));
}
 
开发者ID:gartcimore,项目名称:javamail4ews,代码行数:5,代码来源:EwsStore.java


示例13: findItems

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Obtains a list of item by searching the contents of a specific folder.
 * Calling this method results in a call to EWS.
 *
 * @param parentFolderName the parent folder name
 * @param searchFilter     the search filter
 * @param view             the view
 * @return An object representing the results of the search operation.
 * @throws Exception the exception
 */
public FindItemsResults<Item> findItems(
    WellKnownFolderName parentFolderName, SearchFilter searchFilter,
    ItemView view) throws Exception {
  return this.findItems(new FolderId(parentFolderName), searchFilter,
      view);
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:17,代码来源:ExchangeService.java


示例14: bind

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Binds to an existing user configuration and loads the specified
 * property.
 *
 * @param service          The service to which the user configuration is bound.
 * @param name             The name of the user configuration.
 * @param parentFolderName The name of the folder containing the user configuration.
 * @param properties       The property to load.
 * @return A user configuration instance.
 * @throws IndexOutOfBoundsException the index out of bounds exception
 * @throws Exception                 the exception
 */
public static UserConfiguration bind(ExchangeService service, String name,
    WellKnownFolderName parentFolderName,
    UserConfigurationProperties properties)
    throws IndexOutOfBoundsException, Exception {
  return UserConfiguration.bind(service, name, new FolderId(
      parentFolderName), properties);
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:20,代码来源:UserConfiguration.java


示例15: findFolders

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Obtains a list of folder by searching the sub-folder of the specified
 * folder.
 *
 * @param parentFolderName The name of the folder in which to search for folder.
 * @param searchFilter     The search filter. Available search filter classes include
 *                         SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and
 *                         SearchFilter.SearchFilterCollection
 * @param view             The view controlling the number of folder returned.
 * @return An object representing the results of the search operation.
 * @throws Exception the exception
 */
public FindFoldersResults findFolders(WellKnownFolderName parentFolderName,
    SearchFilter searchFilter, FolderView view) throws Exception {
  return this.findFolders(new FolderId(parentFolderName), searchFilter,
      view);
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:18,代码来源:ExchangeService.java


示例16: save

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Saves the response in the specified folder. Calling this method results
 * in a call to EWS.
 *
 * @param destinationFolderName the destination folder name
 * @return A TMessage that represents the response.
 * @throws Exception the exception
 */
public TMessage save(WellKnownFolderName destinationFolderName)
    throws Exception {
  return (TMessage) this.internalCreate(
      new FolderId(destinationFolderName),
      MessageDisposition.SaveOnly).get(0);
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:15,代码来源:ResponseObject.java


示例17: remove

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Removes the specified well-known folder from the collection.
 *
 * @param folderName The well-knwon folder to remove from the collection.
 * @return True if the well-known folder was successfully removed from the
 * collection, false otherwise.
 */
public boolean remove(WellKnownFolderName folderName) {
  FolderId folderId = FolderId
      .getFolderIdFromWellKnownFolderName(folderName);
  return this.internalRemove(folderId);
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:13,代码来源:FolderIdCollection.java


示例18: FolderId

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Initializes a new instance.Use this constructor to link this FolderId to
 * a well known folder (e.g. Inbox, Calendar or Contacts)
 *
 * @param folderName the folder name
 */
public FolderId(WellKnownFolderName folderName) {
  super();
  this.folderName = folderName;
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:11,代码来源:FolderId.java


示例19: getFolderName

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Gets the name of the folder associated with the folder Id. Name and Id
 * are mutually exclusive; if one is set, the other is null.
 *
 * @return the folder name
 */
public WellKnownFolderName getFolderName() {
  return this.folderName;
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:10,代码来源:FolderId.java


示例20: getFolderIdFromWellKnownFolderName

import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName; //导入依赖的package包/类
/**
 * Defines an implicit conversion between WellKnownFolderName and FolderId.
 *
 * @param folderName the folder name
 * @return A FolderId initialized with the specified folder name
 */
public static FolderId getFolderIdFromWellKnownFolderName(
    WellKnownFolderName folderName) {
  return new FolderId(folderName);
}
 
开发者ID:OfficeDev,项目名称:ews-java-api,代码行数:11,代码来源:FolderId.java



注:本文中的microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BootstrapInfo类代码示例发布时间:2022-05-22
下一篇:
Java SentenceData09类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap