This is good stuff. > Hello, here are some ideas for the Download-Manager. What do you think? > - Repository gets new attribute "trusted", then no check of MD5 > - Artifact gets the same attribute > - if attribute is set to true, then no check of MD5 and the file is > directly copied to the local repository
All sounds good. Further, right now we have a 'runtime attribute' on the ArtifactInstance that tell it where the MD5 or ASC file is to be found. A virtual location. If it isn't there, we could see if the repository was 'untrusted' and not download? > - get MD5-file Ought we simple download it using Download-Manager w/ trusted? :) Ought we not simple copy it down to the local repository location? > - copy file to a tmp-Directory with tmp-Name > - check tmp file to MD5 > - if correct, copy tmp file to local repository with correct name Are there MD5-based streams we can use where the file isn't completed on disk until verified? If not, your approach seems good. BTW: The 'protocols abstraction' (that works over VFS or HttpClient or XXX) might need some work to do this. Right now it dumbly copies from one repo to another (i.e. local). I don't think it even has the concept of 'get'. I can help work on that. > - also copy MD5 file to the local repository, so that later checks could > be also performed > Question: do we use cmdLine md5hash or do we use java? - I like the java > idea, but this could be pretty bad, if the file is large or the md5 > implementation of java does not support the bsd/linux md5 I don't care about speed, we only download when we need to. > - how to unit test this, without a download? - not possible, so the > internet connection should be up and running for the testcase Hmm, that will do for starters, but I'd like to figure this out eventually using MockRepository, etc. Would you be willing to take the DownloadManager development on? I think the 'sharing' we'd get discussing it, and how to implement it, would be education for this team as a whole. I think we'd work out more details with doing it this way. regards Adam