[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] URLs, URIs, and IDs (oh my)


Would IPath really be a valid way to manipulate a general URI? I.e., suppose the URI was http://www.eclipse.org/projects/project_summary.php?projectid=modeling.emf; what would be the IPath and if one asked for the getFileExtension would it return "php"? The conversions, as Jeff is pointing out, do seem very problematic to me. It would seen that conversion to the most general possible form and always manipulating via that form is the only "properly general" way. If that's a valid conclusion, it starts to argue in the direction that this most general representation perhaps ought to be the one uniformly used everywhere...

Scott Lewis wrote:
Hi Jeff,

Some more thoughts about this.

Jeff McAffer wrote:
<stuff deleted>

Many of the usecases don't really involve ECF at all (parish the thought :-). In the broader Equinox/Eclipse context what we need is generic, handy and effcinet ways of manipulating path-like structures. Sometimes they are for files, sometimes URL-like things, ... The real challenge in this space is in encoding and all the UNC/platform whackiness and the conversion between the different forms (e.g., new URL(<unc string>).getPath() does not give you what yoy might hope for).
How do you see IDs fitting in? Would the adapter facility allow people to convert between the different forms?

Yes, it would. So I would envision something like this

Let's suppose some new ID namespaces are created...based upon/using URL, File, EMF URI, java.net URI.

So then client would call:

ID theID = <created externally>
IPath p = (IPath) theID.getAdapter(IPath.class);

This involves no changes to any existing interfaces...just namespace extensions that know how to operate on Strings, emf URI, etc to return an IPath.
We didn't/haven't been using path manipulation as our driving use case up to now...rather we've got adapters like IFileID, IChatID, etc implemented by our namespace extensions. But especially given the existence of good implementations for URI (e.g. emf), IPath (i.e. core.Path), etc. the technical effort to provide such implementations doesn't seem large to me for such use cases.


_______________________________________________ p2-dev mailing list p2-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/p2-dev