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


Java OtherContent.setMimeType方法代碼示例

本文整理匯總了Java中com.google.gdata.data.OtherContent.setMimeType方法的典型用法代碼示例。如果您正苦於以下問題:Java OtherContent.setMimeType方法的具體用法?Java OtherContent.setMimeType怎麽用?Java OtherContent.setMimeType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gdata.data.OtherContent的用法示例。


在下文中一共展示了OtherContent.setMimeType方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPhoto

import com.google.gdata.data.OtherContent; //導入方法依賴的package包/類
private void createPhoto(AlbumEntry albumEntry) throws Exception {
  PhotoEntry photo = new PhotoEntry();

  String title = getString("Title");
  photo.setTitle(new PlainTextConstruct(title));
  String description = getString("Description");
  photo.setDescription(new PlainTextConstruct(description));
  photo.setTimestamp(new Date());

  OtherContent content = new OtherContent();


  File file = null;
  while (file == null || !file.canRead()) {
    file = new File(getString("Photo location"));
  }
  content.setBytes(getBytes(file));
  content.setMimeType(new ContentType("image/jpeg"));
  photo.setContent(content);

  insert(albumEntry, photo);
}
 
開發者ID:google,項目名稱:gdata-java-client,代碼行數:23,代碼來源:PicasawebCommandLine.java

示例2: createXmlContent

import com.google.gdata.data.OtherContent; //導入方法依賴的package包/類
/**
 * Converts XML text to a GData {@code  OtherContent} description of the
 * payload
 * @param xmlSource XML source of the payload
 * @return A GData {@code OtherContent} representation of the payload
 */
public OtherContent createXmlContent(String xmlSource) {
  OtherContent xmlContent = new OtherContent();
  XmlBlob xmlBlob = new XmlBlob();
  xmlBlob.setBlob(xmlSource);
  xmlContent.setXml(xmlBlob);
  xmlContent.setMimeType(APPLICATION_XML);
  return xmlContent;
}
 
開發者ID:jyang,項目名稱:google-feedserver,代碼行數:15,代碼來源:ContentUtil.java

示例3: FeedServerClientTestUtil

import com.google.gdata.data.OtherContent; //導入方法依賴的package包/類
/**
 * Populates bean with static info to match XML. The XML and the bean should
 * be interchangable using utilities provided by FeedServerClient.
 */
public FeedServerClientTestUtil() {
  // Setup sample bean.
  sampleVehicleBean = new VehicleBean();
  sampleVehicleBean.setName(NAME);
  sampleVehicleBean.setOwner(OWNER);
  sampleVehicleBean.setPrice(PRICE);
  sampleVehicleBean.setPropertyName(PROPERTY_NAMES);
  sampleVehicleBean.setPropertyValue(PROPERTY_VALUES);

  // Setup sample map.
  sampleVehicleMap = new HashMap<String, Object>();
  sampleVehicleMap.put("name", NAME);
  sampleVehicleMap.put("owner", OWNER);
  sampleVehicleMap.put("price", PRICE);
  sampleVehicleMap.put("propertyName", PROPERTY_NAMES);
  sampleVehicleMap.put("propertyValue", PROPERTY_VALUES);

  // Create populated gdata entry.
  XmlBlob xmlBlob = new XmlBlob();
  xmlBlob.setBlob(ENTRY_XML);
  OtherContent xmlContent = new OtherContent();
  xmlContent.setXml(xmlBlob);
  xmlContent.setXml(xmlBlob);
  xmlContent.setMimeType(ContentUtil.APPLICATION_XML);
  vehicleEntry = new FeedServerEntry();
  vehicleEntry.setXmlBlob(xmlBlob);
  vehicleEntry.setContent(xmlContent);
}
 
開發者ID:jyang,項目名稱:google-feedserver,代碼行數:33,代碼來源:FeedServerClientTestUtil.java

示例4: setKml

import com.google.gdata.data.OtherContent; //導入方法依賴的package包/類
/**
 * Sets the KML content of the feature as an XmlBlob.  Unless
 * overridden by setKmlDefault, the default namespace of the entry
 * is kml, so the KML placemarks don't need any namespace prefix.
 *
 * @param kml A string representing a KML placemark.
 */
public void setKml(XmlBlob kml) {
  OtherContent content = new OtherContent();
  content.setXml(kml);
  content.setMimeType(KML_CONTENT);
  setContent(content);
}
 
開發者ID:google,項目名稱:gdata-java-client,代碼行數:14,代碼來源:FeatureEntry.java


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