Package com.google.gdata.data.docs

Examples of com.google.gdata.data.docs.DocumentListFeed


public class GoogleOdtLoaderBehaviour {

    @Test
    public void shouldGetResourceFromDocsService() throws IOException, ServiceException {
        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){
View Full Code Here


    if (uploadedExcelDocumentID==null){
      fail("Document Upload Test should run first");
    }

    //Do the call to get the list of the feeds
    DocumentListFeed feed = demo.getDocsListFeed("all");
    assertNotNull("List of Documents returned by Google docs should not be empty",feed);
    assertTrue("DocumentListFeed should have at least one entry (previously uploaded document)",feed.getEntries().size()>0);

    if (feed != null) {

      for (DocumentListEntry entry : feed.getEntries()) {
        demo.printDocumentEntry(entry);
      }
    }

View Full Code Here

   */
  @Override
  public DocumentServiceEntry[] getDocuments(boolean starredOnly) throws DocumentServiceException {
    ArrayList<DocumentServiceEntry> docs = new ArrayList<DocumentServiceEntry>();
    DocsService svc = getDocsService();
    DocumentListFeed feed;
    try {
      String url = DOCS_SCOPE + "default/private/full/";
      if (starredOnly) {
        url += "-/starred";
      } else {
      url += "?showfolders=true";
      }
      feed = svc.getFeed(new URL(url), DocumentListFeed.class);
      for (DocumentListEntry entry : feed.getEntries()) {
        docs.add(getDocumentReference(entry));
      }
    } catch (Exception e) {
      e.printStackTrace();
      throw new DocumentServiceException(e.getMessage());
View Full Code Here

    throws IOException, MalformedURLException, ServiceException
  {
    if (!isServiceInitialized())
      initializeService();
   
    DocumentListFeed feed = getDocsListFeed("documents");
   
    return feed.getEntries();
  }
View Full Code Here

    throws IOException, MalformedURLException, ServiceException
  {
    if (!isServiceInitialized())
      initializeService();
   
    DocumentListFeed feed = getDocsListFeed("all");
   
    return feed.getEntries();
  }
View Full Code Here

    try {
      final String createdEntiry = testSpreadsheet.getTitle().getPlainText();
      DocsService client = new DocsService("yourCo-yourAppName-v1");
      client.setAuthSubToken(authSubToken);
      URL feedUri = new URL("https://docs.google.com/feeds/default/private/full/");
      DocumentListFeed feed = client.getFeed(feedUri, DocumentListFeed.class);
      for (DocumentListEntry entry : feed.getEntries()) {
        final String searchedEntiryTitle = entry.getTitle().getPlainText();
        if (createdEntiry.equals(searchedEntiryTitle)) {
          entry.delete();
          System.out.println("deleted file:" + searchedEntiryTitle);
          break;
View Full Code Here

    try {
      final String createdEntiry = testSpreadsheet.getTitle().getPlainText();
      DocsService client = new DocsService("yourCo-yourAppName-v1");
      client.setAuthSubToken(authSubToken);
      URL feedUri = new URL("https://docs.google.com/feeds/default/private/full/");
      DocumentListFeed feed = client.getFeed(feedUri, DocumentListFeed.class);
      for (DocumentListEntry entry : feed.getEntries()) {
        final String searchedEntiryTitle = entry.getTitle().getPlainText();
        if (createdEntiry.equals(searchedEntiryTitle)) {
          entry.delete();
          System.out.println("deleted file:" + searchedEntiryTitle);
          break;
View Full Code Here

     */
    protected DocumentListEntry getDefaultTargetFolder() throws IOException, ServiceException {
        StopWatch watch = new StopWatch();
        watch.start();
        DocumentListEntry folder = null;
        DocumentListFeed feed = service.getFeed(new URL("https://docs.google.com/"
                + "feeds/default/private/full/folder%3Aroot/contents/-/folder?title=" + defaultTargetFolderName),
                DocumentListFeed.class);
        List<DocumentListEntry> entries = feed.getEntries();

        if (!entries.isEmpty()) {
            folder = entries.get(0);
        } else {
            DocumentListEntry newEntry = new FolderEntry();
View Full Code Here

    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

    return entry;
  }

  private DocumentListEntry findDocumentFolderEntry(String title) throws IOException, ServiceException {
    URL folderFeedUri = new URL("https://docs.google.com/feeds/default/private/full/-/folder");
    DocumentListFeed feed = documentsService.getFeed(folderFeedUri, DocumentListFeed.class);
    for (DocumentListEntry folder : feed.getEntries()) {
      if (folder.getTitle().getPlainText().compareTo(title) == 0) {
        return folder;
      }
    }
    return null;
View Full Code Here

TOP

Related Classes of com.google.gdata.data.docs.DocumentListFeed

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.