Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WARNING: unable to change permissions for everybody:

When running the Java quickstart sample at https://developers.google.com/drive/web/quickstart/java?hl=hu in NetBeans, I'm receiving the error code:

Jun 04, 2015 12:12:11 AM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly WARNING: unable to change permissions for everybody: C:\Users\Quibbles\credentials\drive-api-quickstart 

What am I doing wrong?

Edit: This is the complete error message.

Jun 04, 2015 5:11:39 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly WARNING: unable to change permissions for owner: C:\Users\Quibbles\.credentials\drive-api-quickstart Exception in thread "main" java.lang.NullPointerException     at java.io.Reader.<init>(Reader.java:78)     at java.io.InputStreamReader.<init>(InputStreamReader.java:72)     at DriveQuickstart.authorize(DriveQuickstart.java:64)     at DriveQuickstart.getDriveService(DriveQuickstart.java:87)     at DriveQuickstart.main(DriveQuickstart.java:96) Java Result: 1 
like image 660
quibblify Avatar asked Jun 04 '15 04:06

quibblify


1 Answers

Had the same issue and wasted hours before realizing that "unable to change permissions for owner: C:\Users\Quibbles.credentials\drive-api-quickstart"
is just a warning.

The real issue is the null pointer here.

InputStream in =             DriveQuickstart.class.getResourceAsStream("/client_secret.json"); 

This line was the issue in my case. "in" was null and hence the null pointer.

InputStream in    = new FileInputStream("<Full Path>\\client_secret.json");   

This resolved my issue.

like image 82
C Deepak Avatar answered Sep 16 '22 17:09

C Deepak