You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/07/18 05:20:20 UTC

[jira] [Commented] (KARAF-3727) Cave generates the repository.xml with "bad" path on Windows

    [ https://issues.apache.org/jira/browse/KARAF-3727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15381730#comment-15381730 ] 

ASF subversion and git services commented on KARAF-3727:
--------------------------------------------------------

Commit 2e6f9c223947ce8456a95d49afa9aae6aef927c4 in karaf-cave's branch refs/heads/cave-3.x from [~mhautman]
[ https://git-wip-us.apache.org/repos/asf?p=karaf-cave.git;h=2e6f9c2 ]

[KARAF-3727] Fix repository path on Windows


> Cave generates the repository.xml with "bad" path on Windows
> ------------------------------------------------------------
>
>                 Key: KARAF-3727
>                 URL: https://issues.apache.org/jira/browse/KARAF-3727
>             Project: Karaf
>          Issue Type: Bug
>          Components: cave-repository
>    Affects Versions: cave-2.3.0, cave-3.0.0, cave-4.0.0
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>             Fix For: cave-3.0.1
>
>
> On Windows, when using cave:repository-update nice-repo, the generated repository.xml contains bad paths:
> {code}
> <repository name="test-repo" lastmodified="20150512044028.680">
> <resource id="org.apache.felix.ipojo/1.8.0" 
> symbolicname="org.apache.felix.ipojo" 
> presentationname="Apache Felix iPOJO"     
> uri="file:/C:/foo/bar/apache-karaf-3.0.2/foo/bundle_repo/test-repo/org/apache/felix/org.apache.felix.ipojo/1.8.0/org.apache.felix.ipojo-1.8.0.jar" 
> version="1.8.0">
> {code}
> Especially, the slashes are not good on Windows.
> The issue is that, in the CaveRepositoryImpl, we do:
> {code}
> private void useResourceRelativeUri(ResourceImpl resource) throws Exception {
>     String resourceURI = resource.getURI();
>     String locationURI = "file:" + this.getLocation();
>     LOGGER.debug("Converting resource URI {} relatively to repository URI {}", resourceURI, locationURI);
>     if (resourceURI.startsWith(locationURI)) {
>         resourceURI = resourceURI.substring(locationURI.length() + 1);
>         LOGGER.debug("Resource URI converted to " + resourceURI);
>         resource.put(Resource.URI, resourceURI);
>     }
> }
> {code}
> The problem is that, if the resourceURI looks good (using back slashes), the locationURI uses forward slashes. So the method doesn't trim the URI for the repository.xml and it ends with the full path (instead of the relative one).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)