Get revision history in Google Drive with Java from NetBeans

1

I need to get Google Drive review history. I visited the Drive developers website and I saw that you can do this with several languages. I want to do with Java and use NetBeans and the history I want is that of Google Docs. The code is ready to pick up the history but it needs to have the library. I downloaded the library in this link .

And then I add in NetBeans (I already added the library and the jar files). I did as they say to do but nothing worked. How to do this? The code that gives error by not having the library are these 3 lines:

import com.google.api.services.drive.Drive;
import com.google.api.services.drive.model.Revision;
import com.google.api.services.drive.model.RevisionList;

The error is as follows:

  

package [name] doesnt exist

What do I need to do?

obs: The rest of the programming is as follows (removed directly from the google developers website in the revision item & list):

    package javaapplication8;    

    import com.google.api.services.drive.Drive;
    import com.google.api.services.drive.model.Revision;
    import com.google.api.services.drive.model.RevisionList;

    import java.io.IOException;
    import java.util.List;



    public class MyClass {

      private static List<Revision> retrieveRevisions(Drive service,
      String fileId) {

          fileId = "1XpNdeTFBr2KygyfPtlowBvkpcaJJzjgLckrGjp5oOhg0";
      try {
        RevisionList revisions = service.revisions().list(fileId).execute();
        return revisions.getItems();
      } catch (IOException e) {
        System.out.println("An error occurred: " + e);
      }
      return null;
    }
  }
    
asked by anonymous 24.10.2014 / 14:04

1 answer

1

This error occurs because none of the libraries you imported from the uploaded link have the classes you want to use in the package:

import com.google.api.services.drive .

For this you have the error:

Download this , it has what you need. View API.

    
24.10.2014 / 17:43