incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Woodhead (JIRA)" <>
Subject [jira] Commented: (IVY-615) problems with download() method when extending BasicResolver
Date Thu, 04 Oct 2007 14:49:51 GMT


Adrian Woodhead commented on IVY-615:

Thanks Maarten, that was indeed the issue, I wasn't clear on what methods I needed to implement
on my various classes. I now implemented the exists() method properly in my resource and removed
the download() method from my resolver class and it seems to work just fine now. I still find
the reference to URLRepository in the base class strange but it doesn't seem to break anything
on my side so it's ok. 

> problems with download() method when extending BasicResolver
> ------------------------------------------------------------
>                 Key: IVY-615
>                 URL:
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-alpha-2
>            Reporter: Adrian Woodhead
> When trying to create a SvnResolver I have run into an issue which seems to originate
in BasicResolver. I extend RepositoryResolver which ultimately extends BasicResolver. I implement
various methods in my classes to have dependent files downloaded from subversion over the
svn+ssh protocol  which works OK, however files are downloaded into the local ivy repository
as FILENAME.EXT.part and never renamed to have the .part removed even though they are completely
downloaded. I tracked the issue down to this method in BasicResolver:
> public DownloadReport download(Artifact[] artifacts, DownloadOptions options)
> The code on line 808 is executed:
> adr.setSize(getAndCheck(artifactRef.getResource(), tmp));
> This in turn tries to download a .sha1 file for my resource which fails (there isn't
one) which throws an IOException. This means that the code following where the file is renamed
to have the .part removed is never executed. I don't know enough about the internals of Ivy
to say what the best way to fix this is so I did the following which almost certainly is not
the best solution:
>     try {
>          adr.setSize(getAndCheck(artifactRef.getResource(), tmp));
>     } catch (IOException e) {
>         Message.warn(e.getMessage());
>     }
> I didn't want to change the Ivy code so I moved the entire download method into my class
and then noticed it wouldn't compile due to the object defined at line 104:
>     private URLRepository extartifactrep = new URLRepository(); // used only to download
> I'm not sure why URLRepository is hardcoded here, surely this should use a method like
getRepository() in RepositoryResolver to get the actual repository in use, which in my case
is not a URLRepository but my own SvnRepository. My suggestion would be to move the Repository
member variable and getter and setter from RepositoryResolver up into BasicResolver and change
line 805 in BasicResolver from
>     extartifactrep.get(artifactRef.getResource().getName(), tmp);
> to 
>     getRepository().get(artifactRef.getResource().getName(), tmp);

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message