當前位置: 首頁>>代碼示例>>Java>>正文


Java BasePropertySet類代碼示例

本文整理匯總了Java中microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet的典型用法代碼示例。如果您正苦於以下問題:Java BasePropertySet類的具體用法?Java BasePropertySet怎麽用?Java BasePropertySet使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BasePropertySet類屬於microsoft.exchange.webservices.data.core.enumeration.property包,在下文中一共展示了BasePropertySet類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convert

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
public EwsMessage convert() throws MessagingException, ServiceLocalException, UnsupportedEncodingException {
		 message = new EwsMessage(
					session,
					msgnr,
					emailMessage);
		 try {
//			emailMessage.load();
			PropertySet oPropSetForBodyText = new PropertySet(BasePropertySet.FirstClassProperties);
			oPropSetForBodyText.add(ItemSchema.MimeContent);
			emailMessage.load(oPropSetForBodyText);
		} catch (Exception e) {
			throw new MessagingException(e.getMessage(), e);
		}
		 
		 byte[] bContent = emailMessage.getMimeContent().getContent();
		 ByteArrayInputStream stream = new ByteArrayInputStream(bContent);
		 message.createFromStream(stream);
         setAllHeaders();
         
         return message;
	}
 
開發者ID:gartcimore,項目名稱:javamail4ews,代碼行數:22,代碼來源:EwsMailConverter.java

示例2: getUnreadMessageCount

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
@Override
public synchronized int getUnreadMessageCount() throws MessagingException {
    ItemView unreadView = new ItemView(ITEM_VIEW_MAX_ITEMS);

    PropertySet setIdOnly = new PropertySet(BasePropertySet.IdOnly);
    unreadView.setPropertySet(setIdOnly);

    SearchFilter unreadFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.And,
            new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, Boolean.FALSE));

    FindItemsResults<Item> findResults;
    try {
        findResults = getService().findItems(folder.getId(), unreadFilter, unreadView);
    } catch (Exception e) {
        throw new MessagingException(e.getMessage());
    }
    return findResults.getTotalCount();
}
 
開發者ID:gartcimore,項目名稱:javamail4ews,代碼行數:19,代碼來源:EwsFolder.java

示例3: isRequestedProperty

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
/**
 * Checks if is requested property.
 *
 * @param propertyDefinition the property definition
 * @return true, if is requested property
 */
private boolean isRequestedProperty(PropertyDefinition propertyDefinition) {
  // If no requested property set, then property wasn't requested.
  if (this.requestedPropertySet == null) {
    return false;
  }

  // If base property set is all first-class property, use the
  // appropriate list of
  // property definitions to see if this property was requested.
  // Otherwise, property had
  // to be explicitly requested and needs to be listed in
  // AdditionalProperties.
  if (this.requestedPropertySet.getBasePropertySet() == BasePropertySet.FirstClassProperties) {
    List<PropertyDefinition> firstClassProps =
        this.onlySummaryPropertiesRequested ? this
            .getOwner().getSchema().getFirstClassSummaryProperties() :
            this.getOwner().getSchema().getFirstClassProperties();

    return firstClassProps.contains(propertyDefinition) ||
        this.requestedPropertySet.contains(propertyDefinition);
  } else {
    return this.requestedPropertySet.contains(propertyDefinition);
  }
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:31,代碼來源:PropertyBag.java

示例4: getMessages

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
@Override
public List<Message> getMessages(int start, int end, Date earliestDate, @Nullable MessageRetrievalListener<Message> listener)
        throws MessagingException {
    
    ArrayList<Message> messages = new ArrayList<>();
    try {
        ItemView view = new ItemView(end - start, start);
        view.getOrderBy().add(ItemSchema.DateTimeReceived, SortDirection.Ascending);
        view.setPropertySet(new PropertySet(BasePropertySet.IdOnly));

        FindItemsResults<Item> results = folder.findItems(view);
        List<Item> items = results.getItems();
        int count = items.size();
        for (int i = 0; i < items.size(); i++) {
            String uid = items.get(i).getId().getUniqueId();
            if (listener != null)
                listener.messageStarted(uid, i, count);
            EwsMessage message = new EwsMessage(uid, this);
            messages.add(message);
            if (listener != null)
                listener.messageFinished(message, i, count);
        }
    } catch (Exception e) {
        throw new MessagingException("Failed to fetch messages", e);
    }
    return messages;
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:28,代碼來源:EwsFolder.java

示例5: getContentStream

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
@Override
protected InputStream getContentStream() throws MessagingException {
  try {
    PropertySet oPropSetForBodyText = new PropertySet(BasePropertySet.FirstClassProperties);
    oPropSetForBodyText.add(ItemSchema.MimeContent);
    emailMessage.load(oPropSetForBodyText);
    byte[] lContent = emailMessage.getMimeContent().getContent();

    return new ByteArrayInputStream(lContent);
  } catch (Exception e) {
    throw new MessagingException(e.getMessage());
  }
}
 
開發者ID:gartcimore,項目名稱:javamail4ews,代碼行數:14,代碼來源:EwsMessage.java

示例6: createInstance

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
@Override
public Map<BasePropertySet, String> createInstance() {
  Map<BasePropertySet, String> result = new
      HashMap<BasePropertySet, String>();
  result.put(BasePropertySet.IdOnly,
      BasePropertySet.IdOnly
          .getBaseShapeValue());
  result.put(BasePropertySet.FirstClassProperties,
      BasePropertySet.FirstClassProperties
          .getBaseShapeValue());
  return result;
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:13,代碼來源:PropertySet.java

示例7: PropertySet

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
/**
 * Initializes a new instance of PropertySet.
 *
 * @param basePropertySet      The base property set to base the property set upon.
 * @param additionalProperties Additional property to include in the property set. Property
 *                             definitions are available as static members from schema
 *                             classes (for example, EmailMessageSchema.Subject,
 *                             AppointmentSchema.Start, ContactSchema.GivenName, etc.)
 */
public PropertySet(BasePropertySet basePropertySet,
    Iterator<PropertyDefinitionBase> additionalProperties) {
  this.basePropertySet = basePropertySet;
  if (null != additionalProperties) {
    while (additionalProperties.hasNext()) {
      this.additionalProperties.add(additionalProperties.next());
    }
  }
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:19,代碼來源:PropertySet.java

示例8: createReadonlyPropertySet

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
/**
 * Creates a read-only PropertySet.
 *
 * @param basePropertySet The base property set.
 * @return PropertySet
 */
private static PropertySet createReadonlyPropertySet(
    BasePropertySet basePropertySet) {
  PropertySet propertySet = new PropertySet(basePropertySet);
  propertySet.isReadOnly = true;
  return propertySet;
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:13,代碼來源:PropertySet.java

示例9: getPropertySetFromBasePropertySet

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
/**
 * Implements an implicit conversion between
 * PropertySet and BasePropertySet.
 *
 * @param basePropertySet The BasePropertySet value to convert from.
 * @return A PropertySet instance based on the specified base property set.
 */
public static PropertySet getPropertySetFromBasePropertySet(BasePropertySet
    basePropertySet) {
  return new PropertySet(basePropertySet);
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:12,代碼來源:PropertySet.java

示例10: getBasePropertySet

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
/**
 * Gets the base property set, the property set is based upon.
 *
 * @return the base property set
 */
public BasePropertySet getBasePropertySet() {
  return this.basePropertySet;
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:9,代碼來源:PropertySet.java

示例11: getDefaultPropertySetMap

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
/**
 * Maps BasePropertySet values to EWS's BaseShape values.
 *
 * @return the base property set
 */
public static LazyMember<Map<BasePropertySet, String>> getDefaultPropertySetMap() {
  return PropertySet.defaultPropertySetMap;

}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:10,代碼來源:PropertySet.java

示例12: setBasePropertySet

import microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet; //導入依賴的package包/類
/**
 * Sets the base property set, the property set is based upon.
 *
 * @param basePropertySet Base property set.
 */
public void setBasePropertySet(BasePropertySet basePropertySet) {
  this.throwIfReadonly();
  this.basePropertySet = basePropertySet;
}
 
開發者ID:OfficeDev,項目名稱:ews-java-api,代碼行數:10,代碼來源:PropertySet.java


注:本文中的microsoft.exchange.webservices.data.core.enumeration.property.BasePropertySet類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。