DO NOT REPLY [Bug 40074] New: - get task for apache ant discards parts of files

[email protected]
Newsgroups gmane.comp.jakarta.slide.devel
Message-ID <[email protected]/bugzilla/>
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40074>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40074

           Summary: get task for apache ant discards parts of files
           Product: Slide
           Version: 2.1
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: APIBug, PatchAvailable
          Severity: critical
          Priority: P1
         Component: WebDAV client
        AssignedTo: [email protected]
        ReportedBy: [email protected]


The ant task to get files from a webdav repository discards parts of files. 
This has something to do with the InputStream.available which might 0 whenever
there's still data available in the stream so the remaining data is discarded.
I created a fix by using WebdavResource, which works fine but, because I was in
a hurry, it's a little dirty. Below you'll find the fix.



	private void getAndStoreResource(HttpURL url, File target)throws
IOException,IOException,FileNotFoundException{
		File directory = target.getParentFile();
		if(!directory.exists())
			directory.mkdirs();
		url.setUserinfo(userid,password);
		WebdavResource webdavResource = Utils.getWebdavResource(url);
        log("Downloading  '" +url.getURI());
        if (webdavResource.getMethod(target)) {
           log("succeeded.");
           countWrittenFiles++;
        } else {
           log("failed.");
           log(webdavResource.getStatusMessage());
		}
        webdavResource.close();
	}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.