[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    DO NOT REPLY [Bug 40074]  New:  - get task for apache ant discards parts of files
From:       bugzilla () apache ! org
Date:       2006-07-19 12:40:54
Message-ID: bug-40074-4429 () http ! issues ! apache ! org/bugzilla/
[Download RAW message or body]

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: slide-dev@jakarta.apache.org
        ReportedBy: wheyboer@triennium.com


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.

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic