使用 Google Drive 的这个功能,我得到一个 httpresponseexception。有谁知道为什么?
public static InputStream downloadFile(Drive service, String myurl) {
if (myurl != null && myurl.length() > 0) {
try {
HttpResponse resp = service.getRequestFactory().buildGetRequest(new GenericUrl(myurl))
.execute();
System.out.println("***********"+resp.getContent());
return resp.getContent();
} catch (IOException e) {
// An error occurred.
e.printStackTrace();
return null;
}
} else {
// The file doesn't have any content stored on Drive.
return null;
}
}