Examples of MediaContent


Examples of com.dyuproject.protostuff.benchmark.MediaContent

public class ProtostuffSmileSerializer extends AbstractProtostuffSerializer
{

    public MediaContent deserialize(byte[] array) throws Exception
    {
        MediaContent mediaContent = new MediaContent();
        SmileIOUtil.mergeFrom(array, mediaContent, mediaContent.cachedSchema(), false);
        return mediaContent;
    }
View Full Code Here

Examples of com.dyuproject.protostuff.benchmark.MediaContent

   
    static final Schema<MediaContent> schema = RuntimeSchema.getSchema(MediaContent.class);

    public MediaContent deserialize(byte[] array) throws Exception
    {
        MediaContent mediaContent = new MediaContent();
        ProtobufIOUtil.mergeFrom(array, mediaContent, schema);
        return mediaContent;
    }
View Full Code Here

Examples of com.dyuproject.protostuff.benchmark.V2CodeSizeMedia.MediaContent

        return content.toByteArray();
    }

    public MediaContent create()
    {
        MediaContent contentProto = MediaContent
        .newBuilder().setMedia(
                Media.newBuilder()
                        .setFormat("video/mpg4")
                        .setPlayer(Player.JAVA)
                        .setTitle("Javaone Keynote")
View Full Code Here

Examples of com.dyuproject.protostuff.benchmark.V2LiteMedia.MediaContent

public abstract class AbstractLiteMediaSerializer implements ObjectSerializer<MediaContent>
{
   
    public MediaContent create()
    {
        MediaContent contentProto = MediaContent
        .newBuilder().setMedia(
                Media.newBuilder()
                        .setFormat("video/mpg4")
                        .setPlayer(Player.JAVA)
                        .setTitle("Javaone Keynote")
View Full Code Here

Examples of com.dyuproject.protostuff.benchmark.V2SpeedMedia.MediaContent

public abstract class AbstractSpeedMediaSerializer implements ObjectSerializer<MediaContent>
{
   
    public MediaContent create()
    {
        MediaContent contentProto = MediaContent
        .newBuilder().setMedia(
                Media.newBuilder()
                        .setFormat("video/mpg4")
                        .setPlayer(Player.JAVA)
                        .setTitle("Javaone Keynote")
View Full Code Here

Examples of com.google.gdata.data.MediaContent

            throw new GoogleMediaExportFailed(url, e);
        }
    }

    MediaContent mediaContent(String url) {
        MediaContent mc = new MediaContent();
        mc.setUri(url);
        return mc;
    }
View Full Code Here

Examples of com.google.gdata.data.MediaContent

        DocsService service = mock(DocsService.class);
        DocumentListFeed feed = mock(DocumentListFeed.class);
        DocumentListEntry entry = mock(DocumentListEntry.class);
        MediaSource mediaSource = mock(MediaSource.class);
        InputStream inputStream = mock(InputStream.class);
        final MediaContent content = mock(MediaContent.class);
        final DocumentQuery query = mock(DocumentQuery.class);
        when(service.getFeed(query, DocumentListFeed.class)).thenReturn(feed);
        when(service.getMedia(content)).thenReturn(mediaSource);
        when(feed.getEntries()).thenReturn(asList(entry));
        when(entry.getContent()).thenReturn(content);
        when(content.getUri()).thenReturn("http://docs.google.com");
        when(mediaSource.getInputStream()).thenReturn(inputStream);

        LoadOdtFromGoogle storyLoader = new LoadOdtFromGoogle("user", "password", "https://docs.google.com/feeds/default/private/full/", service){

            @Override
View Full Code Here

Examples of com.google.gdata.data.MediaContent

  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

Examples of com.google.gdata.data.MediaContent

   */
  @Override
  public String getDocumentContents(String contentUrl) throws DocumentServiceException {
    DocsService svc = getDocsService();
    try {
      MediaContent mc = new MediaContent();
      mc.setUri(contentUrl);
      MediaSource ms = svc.getMedia(mc);
      InputStreamReader reader = null;
      try {
        reader = new InputStreamReader(ms.getInputStream(), "UTF8");
        BufferedReader br = new BufferedReader(reader);
View Full Code Here

Examples of com.google.gdata.data.MediaContent

    doc.setStarred(entry.isStarred());
    String prefix = getResourceIdPrefix(entry.getResourceId());
    if (prefix != null && prefix.equalsIgnoreCase("document")) {
      doc.setContentType("text/plain");
      if (entry.getContent() != null) {
        MediaContent mc = (MediaContent) entry.getContent();
      doc.setContentLink(mc.getUri() + "&format=txt&exportFormat=txt");
      } else {
        doc.setContentLink(DOCS_SCOPE +
            "download/documents/Export?format=txt&exportFormat=txt&docID=" +
            entry.getResourceId() + "&id=" + entry.getResourceId());
      }
    } else {
      MediaContent mc = (MediaContent) entry.getContent();
      doc.setContentType(mc.getMimeType().getMediaType());
      doc.setContentLink(mc.getUri());
    }
    //System.out.println("Content Link: " + doc.getContentLink());
    List<Link> parents = entry.getParentLinks();
    String[] folders = new String[parents.size()];
    for (int i=0; i<parents.size(); i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.