警告:无法更改每个人的权限: [英] WARNING: unable to change permissions for everybody:
问题描述
在 https://developers.google.com/drive/上运行Java快速入门示例时web / quickstart / java?hl = hu 在NetBeans中,我收到了错误代码:
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
我做错了什么?
编辑:这是完整的错误信息。
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
推荐答案
如果在实现无法更改所有者权限:C:\ Users \Quibbles.credentials\drive-api-quickstart
$ b之前发生同样的问题并浪费了数小时$ b只是一个警告。
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");
这一行对我来说是个问题。 in为空,因此为空指针。
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");
这解决了我的问题。
这篇关于警告:无法更改每个人的权限:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!