Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313747 - SimpleArtifactRepository fails to transfer files when its location is relative
Summary: SimpleArtifactRepository fails to transfer files when its location is relative
Status: CLOSED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Matthew Piggott CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 11:18 EDT by Matthew Piggott CLA
Modified: 2011-04-26 16:33 EDT (History)
2 users (show)

See Also:
pascal: review+


Attachments
Handle a repository specified with a relative path (3.19 KB, patch)
2010-05-20 14:25 EDT, Matthew Piggott CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.