Package com.google.gdata.client

Examples of com.google.gdata.client.DocumentQuery


            throw new IOException(e);
        }
    }

    private String exportURL(String title) throws IOException, ServiceException, MalformedURLException {
        DocumentQuery query = documentQuery(title);
        List<DocumentListEntry> entries = service.getFeed(query, DocumentListFeed.class).getEntries();
        if (entries.isEmpty()) {
            throw new GoogleDocumentNotFound(title);
        }
        return ((MediaContent) entries.get(0).getContent()).getUri() + "&exportFormat=odt";
View Full Code Here


        }
        return ((MediaContent) entries.get(0).getContent()).getUri() + "&exportFormat=odt";
    }

    DocumentQuery documentQuery(String title) throws MalformedURLException {
        DocumentQuery query = new DocumentQuery(new URL(feedURI));
        query.setTitleQuery(title);
        query.setTitleExact(true);
        query.setMaxResults(1);
        return query;
    }
View Full Code Here

        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");
View Full Code Here

    return entry.updateMedia(true);
  }

  public DocumentListEntry findDocumentEntry(String title) throws IOException, ServiceException {
    DocumentListEntry entry = null;
    DocumentQuery query = new DocumentQuery(documentsFeedUri);
    query.setTitleQuery(title);
    query.setTitleExact(true);
    query.setMaxResults(1);
    DocumentListFeed feed = documentsService.getFeed(query, DocumentListFeed.class);
    if (feed != null && feed.getEntries().size() > 0) {
      entry = feed.getEntries().get(0);
    }
    return entry;
View Full Code Here

      url = buildUrl(URL_DEFAULT + URL_DOCLIST_FEED + URL_CATEGORY_TRASHED);
    } else {
      return null;
    }

    DocumentQuery query = new DocumentQuery(url);
    // if (!category.equals("folders")) {
    // query.setMaxResults(101);
    // }

    return service.getFeed(query, DocumentListFeed.class);
View Full Code Here

     */
    public DocumentListEntry getFolder() throws Exception {
        try {
            URL feedUri = new URL(
                    "https://docs.google.com/feeds/default/private/full/-/folder");
            DocumentQuery query = new DocumentQuery(feedUri);
            query.setTitleQuery("netmus-libraries");
            query.setTitleExact(true);
            query.setMaxResults(1);
            DocumentListFeed feed = client().getFeed(query,
                    DocumentListFeed.class);
            List<DocumentListEntry> entry = feed.getEntries();
            return entry.get(0);
        } catch (MalformedURLException e) {
View Full Code Here

TOP

Related Classes of com.google.gdata.client.DocumentQuery

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.