I want to change the picture in contacts api but i got some exception please check my code
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=apps...@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();
when i call request.execute(); i got following exception
com.google.gdata.util.InvalidEntryException: Bad Request Invalid image file
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)
please help me....