Package com.google.gdata.data

Examples of com.google.gdata.data.MediaContent


        }
        if (entry.getSummary() != null) {
          System.out.println("  description: " + entry.getSummary().getPlainText());
        }
        System.out.println("  revision: " + entry.getRevision().getValue());
        MediaContent content = (MediaContent) entry.getContent();
        System.out.println("  src: " + content.getUri());
        System.out.println("  content type: " + content.getMimeType().getMediaType());
        System.out.println("");
      }

      for (WebAttachmentEntry entry : contentFeed.getEntries(WebAttachmentEntry.class)) {
        System.out.println("WebAttachmentEntry:");
View Full Code Here


     */
    private void downloadFile(String downloadUrl, String fullFilePath) throws IOException,
        ServiceException {
      System.out.println("Downloading file from: " + downloadUrl);

      MediaContent mc = new MediaContent();
      mc.setUri(downloadUrl);
      MediaSource ms = service.getMedia(mc);

      InputStream inStream = null;
      FileOutputStream outStream = null;

View Full Code Here

                textContent.getContent().getPlainText() +
                "</body></html>"));
       
      } else if (content instanceof MediaContent) {
       
        MediaContent mediaContent = (MediaContent) content;
        map.put(SpiConstants.PROPNAME_MIMETYPE,
            makeProperty(mediaContent.getMimeType().getMediaType() ));
        map.put(SpiConstants.PROPNAME_CONTENT,
            makeProperty(mediaContent.getMediaSource()));
       
      } else if (content instanceof OtherContent) {
       
        OtherContent otherContent = (OtherContent) content;
        map.put(SpiConstants.PROPNAME_MIMETYPE,
View Full Code Here

    }
  }
 
  public InputStream getPdfInputStream(DocumentListEntry document) throws ServiceException {
    String exportUrl = ((MediaContent)document.getContent()).getUri() + "&exportFormat=pdf";
    MediaContent mc = new MediaContent();
    mc.setUri(exportUrl);
    try {
      MediaSource ms = client().getMedia(mc);
      return ms.getInputStream();
    } catch (IOException e) {
      throw new RuntimeException(e);
View Full Code Here

  public void downloadFile(URL exportUrl, String filepath) throws IOException, MalformedURLException, ServiceException, DocumentListException {
    if (exportUrl == null || filepath == null) {
      throw new DocumentListException("null passed in for required parameters");
    }

    MediaContent mc = new MediaContent();
    mc.setUri(exportUrl.toString());
    MediaSource ms = service.getMedia(mc);

    InputStream inStream = null;
    FileOutputStream outStream = null;
View Full Code Here

TOP

Related Classes of com.google.gdata.data.MediaContent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.