What is equivalent of HTTP PUT request in JAVA

I am very new to JAVA.

I need to rewrite in java UNIX script which uploads

tar.file to a server.

Here is the script:

-

#! /bin/csh -f

set file = 'job.results.tar'

set url= 'http://xxx.xxx.edu:8080/cgi-bin/app_submit_job'

curl -T $file $url

-

I am familiar with java.net package and know how to Read and Write Streams.

However, what I do not know is what string represntation of PUT or POST resquests is?

Can and should I use java.net package, or I better off using jacarta packages?

Thanks in advance for help.

[602 byte] By [kmara] at [2007-11-27 9:03:23]
# 1
Check out the HttpClient Class from Apache. Google for it.Other possibilites are to Google for example off HttpUrlConnection.
masijade.a at 2007-7-12 21:35:23 > top of Java-index,Java Essentials,Java Programming...
# 2

> I am familiar with java.net package and know how to

> Read and Write Streams.

> However, what I do not know is what string

> represntation of PUT or POST resquests is?

It's HttpURLConnection.setRequestMethod("PUT") or ("POST").

Also you have to setDoOutput(true).

Then you set the content type, possibly encode the input, set the content length, and write the file data to the stream.

Using a Jakarta package may be easier, however.

paulcwa at 2007-7-12 21:35:23 > top of Java-index,Java Essentials,Java Programming...