Try something like this:

GetMethod getMethod = new GetMethod("uri_to_download");
getMethod.setRequestHeader("Range", "bytes=500-999");
int status = httpClient.executeMethod(getMethod);
if (status == 206) {
    byte[] filePart = getMethod.getResponseBody();
}

Hope, that helps.
Ingo

> hi,
> 
> thanks for you email.
> 
> do you mean I can use the setRequestHeader as setRequestProperty in 
> java.net.HttpURLConnection? Could you give me an example for how to use the 
> method? thanks a lot.
> 
> 
> 
> 
> >From: Ingo Brunberg <[EMAIL PROTECTED]>
> >Reply-To: "Slide Users Mailing List" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: Big file download problem.
> >Date: Thu, 13 May 2004 11:10:04 +0200
> >
> >Of course you can do this. Just set an appropriate request header on
> >the GetMethod -> setRequestHeader(...)
> >
> >Ingo
> >
> > > hi,
> > >
> > > it is a common idea, if a file is very big, we may hope the flie in 
> >slide
> > > can be downloaded  off and on.
> > >
> > > As I know, the WebDAV is an extension of HTTP. The
> > > java.net.HttpURLConnection class provides setRequestProperty method. And
> > > then I can use the method to download the file off and on  by set the
> > > "Range" property.
> > >
> > > However, I cannot find such method in WebDAV client API, does the API
> > > provide the similar functions to download files continuously?
> > >
> > > I think, it is a very common question for most of guys.
> > >
> > > _________________________________________________________________
> > > Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> > > http://join.msn.com/?page=features/featuredemail
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online 
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to