0
我跟隨谷歌驅動器V3快速啓動 tutorial 我不想使用Gradle的這個應用程序,因爲是一個團體項目。
我已經下載了谷歌驅動器v3庫。谷歌Drive api Java快速入門EOFException
我正在使用Intellij,並且已將所有jar添加到類路徑中。所有jar都成功導入,並且IDE不會給出任何錯誤。
在運行時,我收到一條警告,表明在線閱讀似乎是Windows兼容性問題。
我已經下載了用戶ID和用戶祕密以.json文件,並把它放在同一個文件夾作爲主
我的代碼是一樣的快速入門例子的一個:
錯誤我得到的是以下幾點:
Apr 06, 2017 2:31:52 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly
WARNING: unable to change permissions for everybody: C:\Users\HP\.credentials\drive-java-quickstart
Apr 06, 2017 2:31:52 PM com.google.api.client.util.store.FileDataStoreFactory setPermissionsToOwnerOnly
WARNING: unable to change permissions for owner: C:\Users\HP\.credentials\drive-java-quickstart
Exception in thread "main" java.io.EOFException
\t at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2624)
\t at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3099)
\t at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:853)
\t at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349)
\t at com.google.api.client.util.IOUtils.deserialize(IOUtils.java:171)
\t at com.google.api.client.util.store.FileDataStoreFactory$FileDataStore.<init>(FileDataStoreFactory.java:102)
\t at com.google.api.client.util.store.FileDataStoreFactory.createDataStore(FileDataStoreFactory.java:73)
\t at com.google.api.client.util.store.AbstractDataStoreFactory.getDataStore(AbstractDataStoreFactory.java:55)
\t at com.google.api.client.auth.oauth2.StoredCredential.getDefaultDataStore(StoredCredential.java:171)
\t at com.google.api.client.auth.oauth2.AuthorizationCodeFlow$Builder.setDataStoreFactory(AuthorizationCodeFlow.java:736)
\t at com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow$Builder.setDataStoreFactory(GoogleAuthorizationCodeFlow.java:209)
\t at com.elox.Main.authorize(Main.java:77)
\t at com.elox.Main.getDriveService(Main.java:93)
\t at com.elox.Main.main(Main.java:103)
\t at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\t at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
\t at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
\t at java.lang.reflect.Method.invoke(Method.java:498)
\t at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
我不明白爲什麼我得到這個錯誤或我怎麼能改正它
你有哪些用戶憑證? – Flikk