Take a look at the Apache HttpClient JavaDocs (
http://hc.apache.org/httpclient-3.x/apidocs/index.html) as that's what the
WebDAV client is based on.
Specifically, the non-deprecated way of doing what you have below is:
put.setRequestEntity(new StringRequestEntity("new content is being added 4",
"text/plain", "UTF-8");
There are other RequestEntity classes for InputStream, File, byte arrays
etc. You can also roll your own implementation of the RequestEntity
interface, although I've never needed to do this myself.
HTH,
Justin
On Mon, Jan 11, 2010 at 3:58 PM, mrbahr <[email protected]> wrote:
>
> I am a newbie to Jackrabbit and am working on creating a WebDAV client
> which
> connects to a remote JackRabbit server running under Tomcat.
>
> There is little documentation on using the package, but, I'm getting around
> through trial and error. I am currently working with 1.6.0.
>
> I have the following dependency in maven:
>
> <dependency>
> <groupId>org.apache.jackrabbit</groupId>
> <artifactId>jackrabbit-webdav</artifactId>
> <version>1.6.0</version>
> </dependency>
>
> I am using the method
>
> PutMethod put = new PutMethod(host +
> "/com/presidioHealth/TestMe4.txt");
> put.setRequestBody(new String("new content is being added
> 4"));
> client.executeMethod(put);
> System.out.println("PUT - " + put.getStatusCode() + " - " +
> put.getStatusText());
>
> This works, however, it appears as though "put.setRequestBody(String) and
> InputStream" are both deprecated. Even though they still work, they are
> being deprecated. What is replacing them?
>
> I need to be able to upload binary files or objects and not sure what the
> method should be to do it?
>
> What is the best way to upload binary data into the repository using the
> WebDAV methods.
>
> Thanks,
> Tom
> --
> View this message in context:
> http://n4.nabble.com/WebDav-PUTMethod-Deprecation-adding-binary-data-tp1011577p1011577.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>