Google Drive api Java QuickStart EOFException -


i following google drive v3 api quickstart tutorial don't want use gradle application since group project.
have downloaded google drive v3 libraries.

i using intellij, , have added of jar class path. jars imported , ide doesn't give error.
@ run time warning reading online seems problem windows compatibility.
have downloaded .json file user id , user secret , placed in same folder main
code same 1 of quickstart example:

the error following:

apr 06, 2017 2:31:52 pm com.google.api.client.util.store.filedatastorefactory setpermissionstoowneronly  warning: unable change permissions 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 change permissions owner: c:\users\hp\.credentials\drive-java-quickstart  exception in thread "main" java.io.eofexception  	at java.io.objectinputstream$peekinputstream.readfully(objectinputstream.java:2624)  	at java.io.objectinputstream$blockdatainputstream.readshort(objectinputstream.java:3099)  	at java.io.objectinputstream.readstreamheader(objectinputstream.java:853)  	at java.io.objectinputstream.<init>(objectinputstream.java:349)  	at com.google.api.client.util.ioutils.deserialize(ioutils.java:171)  	at com.google.api.client.util.store.filedatastorefactory$filedatastore.<init>(filedatastorefactory.java:102)  	at com.google.api.client.util.store.filedatastorefactory.createdatastore(filedatastorefactory.java:73)  	at com.google.api.client.util.store.abstractdatastorefactory.getdatastore(abstractdatastorefactory.java:55)  	at com.google.api.client.auth.oauth2.storedcredential.getdefaultdatastore(storedcredential.java:171)  	at com.google.api.client.auth.oauth2.authorizationcodeflow$builder.setdatastorefactory(authorizationcodeflow.java:736)  	at com.google.api.client.googleapis.auth.oauth2.googleauthorizationcodeflow$builder.setdatastorefactory(googleauthorizationcodeflow.java:209)  	at com.elox.main.authorize(main.java:77)  	at com.elox.main.getdriveservice(main.java:93)  	at com.elox.main.main(main.java:103)  	at sun.reflect.nativemethodaccessorimpl.invoke0(native method)  	at sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62)  	at sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)  	at java.lang.reflect.method.invoke(method.java:498)  	at com.intellij.rt.execution.application.appmain.main(appmain.java:147)

i don't understand why error or how correct it

i know old post, had exact same stacktrace , couldn't find answer. so, i'm posting in hopes come after me.

the issue appears related file/directory permissions. changed filepath being used filedatastorefactory directory application had read/write permissions to, oauth2 worked correctly. so, make sure using non-restricted filepath , of directories have correct ownership , permissions.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -