Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313747

Summary: SimpleArtifactRepository fails to transfer files when its location is relative
Product: [Eclipse Project] Equinox Reporter: Matthew Piggott <matthew>
Component: p2Assignee: Matthew Piggott <matthew>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pascal, tjwatson
Version: unspecifiedFlags: pascal: review+
Target Milestone: 3.6.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Handle a repository specified with a relative path tjwatson: iplog+

Description Matthew Piggott CLA 2010-05-20 11:18:27 EDT
In some applications (such as director) a local repository can be specified relatively (ie file:../repo) and the repository manager is happy to load the location.  Unfortunately if it contains an artifact repository if p2 attempts to transfer a file from that repository it fails.

In Mapper#doReplacement() the platform URIUtil.fromString is called which strips the scheme from relative URIs and the result is eventually passed to the transfer layer which doesn't have a provider for a NULL scheme.  If the scheme isn't removed then ECF is able to transfer the file from the relative URI.  Another possibility might be to determine the absolute path of the repository prior to determining the location of an artifact.

Interestingly relative paths which refer to a zipped repository work (ie, jar:file../path.zip!/)
Comment 1 Matthew Piggott CLA 2010-05-20 14:25:28 EDT
Created attachment 169394 [details]
Handle a repository specified with a relative path

When the scheme is NULL and the repository location has a file scheme resolve the artifact path against the System.property("user.dir")
Comment 2 Pascal Rapicault CLA 2010-08-18 12:07:28 EDT
Patch reviewed and released in 3.6.x and HEAD.
Comment 3 DJ Houghton CLA 2010-09-16 12:04:03 EDT
There was a problem with tagging HEAD so this fix won't appear in integration builds until the first build after 3.7 M2.