当前位置: 首页>>代码示例>>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;未经允许,请勿转载。