Using Dropbox Java API for uploading files to dropbox(使用 Dropbox Java API 将文件上传到 Dropbox)
问题描述
我想使用 DropBox 的 java API 上传文件.以下代码为我提供了 oauth_token 和 oauth_secret.但是每当我尝试上传文件时,我都会遇到异常.Java 类
I want to upload files using the java API for DropBox. The following code gets me the oauth_token and oauth_secret. but when ever I try to upload a file I get a exception.
Java Class
异常
一些额外的信息
我将 httpclient-4.0-beta1.jar 和 httpcore-4.0-alpha6.jar 分别更改为 httpclient-4.0.jar 和 httpcore-4.0.1.jar,我不再得到上述异常 [ java.lang.NoSuchMethodError ]
这个stackoverflow问题帮助我解决了这个问题:java.lang.NoSuchMethodError: org.apache.http.protocol.BasicHttpContext: 方法 <init>()V 未找到
I changed the httpclient-4.0-beta1.jar and httpcore-4.0-alpha6.jar to httpclient-4.0.jar and httpcore-4.0.1.jar respectively and I no longer get the above exception [ java.lang.NoSuchMethodError ]
This stackoverflow question helped me in solving this : java.lang.NoSuchMethodError: org.apache.http.protocol.BasicHttpContext: method <init>()V not found
但现在我在执行 API 的任何方法时都会收到 UnknownhostException
But Now I get UnknownhostException on execution of any methods of the API
推荐答案
你应该使用http-client 4.0.3 jar
You should use http-client 4.0.3 jar
这篇关于使用 Dropbox Java API 将文件上传到 Dropbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!