* *我想更改联系人 api 中的图片,但我遇到了一些异常,请检查我的代码
String filepath="C:\\Users\\bhanuprasad\\Documents\\Downloads\\549002_459129587462191_1689883124_n.jpg";
File file = new File(filepath);
byte[] photoData = new byte[(int) file.length()];
String url="https://www.google.com/m8/feeds/profiles/domain/"+ sDomain + "/full/pcvita1111qaeteam10?xoauth_requestor_id=appsadmin@soharcoas.com" ;
ContactEntry profile = contactService.getEntry(
new URL(url),ContactEntry.class);
GDataRequest request = contactService.createRequest(GDataRequest.RequestType.UPDATE,
photoUrl, new ContentType("image/jpeg"));
request.setEtag(photoLink.getEtag());
OutputStream requestStream = request.getRequestStream();
requestStream.write(photoData);
request.execute();
当我调用 request.execute(); 我有以下异常
com.google.gdata.util.InvalidEntryException:错误请求无效图像文件
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:594)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
请帮我....