How to automate creating google driver folders via sdk? - google-drive-api

I want to automate creation of google docs folder via sdk. is that possible via google driver sdk or google app scripting ?
https://developers.google.com/google-apps/

The relevant docs, which describe the creation of folders, are at:
https://developers.google.com/drive/web/folder
Creating a folder uses the same request as creating a file. Assigning the correct MIME type to the file makes it act as a folder.

Related

How to explore Google Endpoint API hosted over HTTP without generating google chrome files in my project folder?

I am testing my Google Endpoint API over localhost. And to test the api locally, I am following this command suggested from google- (https://developers.google.com/explorer-help/#hitting_local_api)
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --user-data-dir="C:\Users\Probhat\workspace\codesap" --unsafely-treat-insecure-origin-as-secure=http://localhost:8888
It is working fine. I can access the API's. But the main problem here is that the command itself generating some extra files in my project folder. And the files are very irritating while developing the project.
Earlier I can easily load the api's just clicking "Load Unsafe Scripts". It did not generate the chrome files. But this is not working now.
I want to know is there any way to test the API's in Chrome without generating those files?

Android Maps API v2 : The import com.google.android.gms.maps.model.IndoorBuilding cannot be resolved

I tried to make demo application of google indoor maps but i am not able to access some interfaces and some classes.
I added google play services project as a project library in my sample application. you can see in image all other classes and interface i am able to access but not about indoor related. Is there any problem?
Please help me, any help would be appreciated.
Error : "The import com.google.android.gms.maps.model.IndoorLevel cannot be resolved"
Here is the image of error.
The newest Google Play Services should be version 22, you can check in SDK manager. The LocationClient should already been deprecated. So If you have the newest version, LocationClient should not be contained.
You should use the Google Play Service Project file in this location:
<YOUR_ANDROID_SDK_LOCATION>/extras/google/google_play_services/libproject/google-play-services_lib/
(The jar file is in:<YOUR_ANDROID_SDK_LOCATION>/extras/google/google_play_services/libproject/google-play-services_lib/libs/)
I included the newest play service jar file in this Google Drive link.
You should follow the the steps here: http://developer.android.com/google/play-services/setup.html#Setup to setup your Google Play Services correctly.
Alternately, you can install the Google Repository from the SDK manager.

Command line tool for Google drive like Dropbox Uploader

Is there any open source project for Google Drive API via command line interface.
I'm detected a CLI project for Dropbox.
https://github.com/andreafabrizi/Dropbox-Uploader
Also My product required GDrive CLI access program.
Is there any project ? Please help me.
Check out GoogleCL. They have an interface for Docs, but in reality it supports arbitrary file types and stores the results in your Drive.
Beware though, you do need a specific of python-gdata (part of the package). Make sure to get the latest version of the code and you should be good. See here for more details.

HTML5 and filesystem management

I have a directory with files and I want to search into that directory for some files types.
Is it possible to do that with the new file-system API?
No, You are restricted to a sand-boxed directory client side directory within the AppData for your web-browswer.
With Chrome and windows 7 for example:
C:\Users\{user}\AppData\Local\Google\Chrome\{browswer-user}\Default\File System\
Also, you can only access files/directories you've generated and populated via API calls.

Google Drive DriveCommandLine sample app not working?

Is the Google Drive API sample command line app (DriveCommandLine) currently known to work? I have downloaded the Java client library, and compiled the sample application (inserting my application's client ID and secret created by specifying "installed application" and "other"). It runs and informs me to access the following link in a browser:
https://accounts.google.com/o/oauth2/auth?access_type=online&approval_prompt=auto&client_id=MY_ACTUAL_CLIENT_ID&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/drive
(Obviously with my actual client ID there.)
This successfully provides me with an authentication code. When I enter this at the application's prompt, then at the line:
File file = service.files().insert(body, mediaContent).execute();
I get the exception:
Exception in thread "main" com.google.api.client.http.HttpResponseException: 401 Unauthorized
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:978)
at com.google.api.client.googleapis.media.MediaHttpUploader.executeUploadInitiation(MediaHttpUploader.java:338)
at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:252)
at com.google.api.services.drive.Drive$Files$Insert.executeUnparsed(Drive.java:309)
at com.google.api.services.drive.Drive$Files$Insert.execute(Drive.java:331)
at DriveCommandLine.main(DriveCommandLine.java:56)
Investigation shows that the GoogleCredential returned has all elements set to null (which seems wrong).
The version of the Drive API client that I am using is "v2-rev5-1.7.2-beta", which is the one currently pointed to on the quickstart page here:
https://developers.google.com/drive/quickstart
I am compiling and running with this JAR and all the ones in the "libs" subdirectory in the classpath (the quickstart page refers to adding source JARs to the classpath which, obviously, dosn't work).
Can anyone shed any light on what might be going wrong here?
Thanks!
The link in the Quick Start is outdated. Try downloading the Drive SDK from the following link: http://code.google.com/p/google-api-java-client/wiki/APIs#Drive_API
See if that makes a difference for you. I have the DriveCommandLine app running fine.
You need to download JSON file from the API access page at
https://cloud.google.com/console.
Rename this json file as "client_secrets.json"
Copy this json into your project folder or more specifically copy it
into "src/main/resources". (This file contains the clientID and secrets). If the file is already present in the folder then replace it.
Now run the project. You will be redirect to Google Drive's "allow
access" page.
PS - json file must belong to an "Installed Type Application" because this is a commandline sample and runs locally.