From fully-qualified OS pathname to IResource [message #325897] |
Sun, 02 March 2008 01:42  |
Eclipse User |
|
|
|
Originally posted by: fraserofthenight.gmail.com
Hi,
I know this question has probably been asked a million times before, but
a cursory search didn't come up with anything. How do I get an IResource
from a fully-qualified OS-specific pathname? It may not eb physically
within the workspace (i.e. if a project resides on a path outside the
workspace root). For example, if I have something like:
"C:\Users\name\projects\project1\foo\bar\baz.d"
How do I get an IResource form that?
|
|
|
|
|
|
Re: From fully-qualified OS pathname to IResource [message #325918 is a reply to message #325915] |
Mon, 03 March 2008 07:30  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------060208000705020406070501
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Robert,
Funny you should mention patience. I just happened to blog about that
very topic last week. :-P
Patience is a Virtue
< http://ed-merks.blogspot.com/2008/02/patience-is-virtue.html>
Robert Fraser wrote:
> Excellent! Thank you both for your replies & patience!
>
> Marc E wrote:
>> I've had success with this:
>> File file = ...whatever();
>>
>> IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
>> IFile fileResource = wsroot.getFileForLocation(new
>> Path(file.getAbsolutePath()));
>>
>> best,
>>
>> marc
>>
>>
>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>> news:fqe4ur$pko$1@build.eclipse.org...
>>> Robert,
>>>
>>> IWorkspaceRoot.findFilesForLocation. There might be more than one...
>>>
>>>
>>> Robert Fraser wrote:
>>>> Hi,
>>>>
>>>> I know this question has probably been asked a million times
>>>> before, but a cursory search didn't come up with anything. How do I
>>>> get an IResource from a fully-qualified OS-specific pathname? It
>>>> may not eb physically within the workspace (i.e. if a project
>>>> resides on a path outside the workspace root). For example, if I
>>>> have something like:
>>>>
>>>> "C:\Users\name\projects\project1\foo\bar\baz.d"
>>>>
>>>> How do I get an IResource form that?
--------------060208000705020406070501
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Robert,<br>
<br>
Funny you should mention patience. I just happened to blog about that
very topic last week. :-P<br>
<blockquote>
<h3 class="post-title entry-title"><a
href=" http://ed-merks.blogspot.com/2008/02/patience-is-virtue.html">Patience
is a Virtue</a></h3>
</blockquote>
<br>
Robert Fraser wrote:
<blockquote cite="mid:fqgem8$bvv$1@build.eclipse.org" type="cite">Excellent!
Thank you both for your replies & patience!
<br>
<br>
Marc E wrote:
<br>
<blockquote type="cite">I've had success with this:
<br>
File file = ...whatever();
<br>
<br>
IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
<br>
IFile fileResource = wsroot.getFileForLocation(new
Path(file.getAbsolutePath()));
<br>
<br>
best,
<br>
<br>
marc
<br>
<br>
<br>
"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com"><merks@ca.ibm.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:fqe4ur$pko$1@build.eclipse.org">news:fqe4ur$pko$1@build.eclipse.org</a>...
<br>
<blockquote type="cite">Robert,
<br>
<br>
IWorkspaceRoot.findFilesForLocation. There might be more than one...
<br>
<br>
<br>
Robert Fraser wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
I know this question has probably been asked a million times before,
but a cursory search didn't come up with anything. How do I get an
IResource from a fully-qualified OS-specific pathname? It may not eb
physically within the workspace (i.e. if a project resides on a path
outside the workspace root). For example, if I have something like:
<br>
<br>
"C:\Users\name\projects\project1\foo\bar\baz.d"
<br>
<br>
How do I get an IResource form that? </blockquote>
</blockquote>
</blockquote>
</blockquote>
<br>
</body>
</html>
--------------060208000705020406070501--
|
|
|
Powered by
FUDForum. Page generated in 0.02856 seconds