Allow remote repository to be located via non-http URI

Alan Bateman Alan.Bateman at oracle.com
Tue Feb 7 03:30:08 PST 2012


On 07/02/2012 11:05, Chris Hegarty wrote:
> This looks good.
>
> One minor comment; Should the arg passed to add-repo, if the scheme is 
> unspecified, be checked to see if it is a directory? Or maybe this 
> isn't all that useful ( it may be a dir, but not a valid repository ). 
When you add a repository then its catalog is fetched so it will fail if 
it's not a valid repository.

> The error handling in SimpleLibrary$RepoList.add could be more robust 
> to handle this by removing the repoDir ( and its contents ) and 
> possibly decrementing the count?
I agree the error handling should be more robust and it should rollback 
the changes but this is an existing problem. I'd prefer to separate it 
from this patch. I also think there is a lot more than could be done 
with the repository support, it's very much a prototype implementation 
at present.

>
> Also (related) what is the point of appending the '/' in canonicalize? 
> If the file url points to a file then it will not end in a '/', 
> therefore it cannot be a valid repo, right? Should this be an error, 
> or just handled as above?
A trailing slash is required as otherwise the URI resolution will not 
work as expected (remember that URI resolution will concatenate all but 
the last segment of the URI's path). You are right that if a file path 
is specified and we convert it to a URI and so will have a trailing 
slash if a directory but this code has to work with other URI schemes too.

-Alan



More information about the jigsaw-dev mailing list