Hi,

 

I am using Sharepoint 2007 and I want to checkout & checkin the document
through java program. I tried using JackRabbit Web Dav but its not
working fine. 

Though it shows the status as 200 & OK but nothing happens at sharepoint
end. Their version remains the same & the document content also remains
same.

Below is the code I am using:

 

************************************************************************
************************************************************************
******************************

public void updateDocument(HttpClient client, String resourcePath, File
file){

CheckoutMethod checkoutMethod = new CheckoutMethod(resourcePath + "/" +
file.getName());

      client.executeMethod(checkoutMethod);

 

      PutMethod putMethod = new PutMethod(resourcePath + "/" +
file.getName());

      RequestEntity requestEntity = new InputStreamRequestEntity(new
FileInputStream(file));

      putMethod.setRequestEntity(requestEntity);

          

      client.executeMethod(putMethod);

      System.out.println(putMethod.getStatusCode() + " "+
putMethod.getStatusText());

 

}

************************************************************************
************************************************************************
*********************************

Regards,

Akshat

 

Reply via email to