Register Your Application

Activate the Drive API and Drive SDK



Create an OAuth 2.0 Client ID

Input product name

Select application type

Download JSON

Checkout Instructions

Clone the project from remote

      $ cd [someDirectory]

      $ hg clone https://code.google.com/p/google-api-java-client.samples/ 
        google-api-java-client-samples

      $ cd google-api-java-client-samples/drive-cmdline-sample

      $ cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json
    

Init variables in DriveSample.java

Compile and Run

      $ mvn compile
      $ mvn -q exec:java
    

Input Usrname and Passwd

Apply the request

if there is no errors displayed,
and you will see a file named "drivetest-XXX" in the local dictory.

<Thank you for your watch!>