Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How can I get an ITextFileBuffer given a IFileStore?
How can I get an ITextFileBuffer given a IFileStore? [message #304845] Thu, 15 June 2006 21:29 Go to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
Sorry if this is posted to the wrong newsgroup. I couldn't find one
which is specific to the Eclipse resource API.

Basically, I'd like to use the new Eclipse File System (EFS) along with
ITextFileBuffers. I can't find a way to do this, however.

When using the EFS, it looks like I'm supposed to use the fileSystem's
getStore(URI) method to get an instance of IFileStore which represents a
file in some file system. From here, I don't know what I'm supposed to do to
get an ITextFileBuffer representing the contents of that file.

Before EFS, I'd use the FileBuffers facade to get the
TextFileBufferManager. I could then call the getTextFileBuffer(IPath) method
to get an ITextFileBuffer (being sure to connect to the resource pointed by
the IPath first).

So how can I get an ITextFileBuffer given a IFileStore?

- Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #304848 is a reply to message #304845] Fri, 16 June 2006 07:07 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Oliver Wong wrote:

> Sorry if this is posted to the wrong newsgroup. I couldn't find one
> which is specific to the Eclipse resource API.
>
> Basically, I'd like to use the new Eclipse File System (EFS) along
> with ITextFileBuffers. I can't find a way to do this, however.
>
> When using the EFS, it looks like I'm supposed to use the
> fileSystem's getStore(URI) method to get an instance of IFileStore
> which represents a file in some file system. From here, I don't know
> what I'm supposed to do to get an ITextFileBuffer representing the
> contents of that file.
>
> Before EFS, I'd use the FileBuffers facade to get the
> TextFileBufferManager. I could then call the getTextFileBuffer(IPath)
> method to get an ITextFileBuffer (being sure to connect to the
> resource pointed by the IPath first).
>
> So how can I get an ITextFileBuffer given a IFileStore?

Use new Path(yourFileStore.toURI().getPath());

Dani

>
> - Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #304864 is a reply to message #304848] Fri, 16 June 2006 13:50 Go to previous messageGo to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:e6tlcm$h5h$1@utils.eclipse.org...
> Oliver Wong wrote:
>
>> Sorry if this is posted to the wrong newsgroup. I couldn't find one
>> which is specific to the Eclipse resource API.
>>
>> Basically, I'd like to use the new Eclipse File System (EFS) along
>> with ITextFileBuffers. I can't find a way to do this, however.
>>
>> When using the EFS, it looks like I'm supposed to use the fileSystem's
>> getStore(URI) method to get an instance of IFileStore which represents a
>> file in some file system. From here, I don't know what I'm supposed to do
>> to get an ITextFileBuffer representing the contents of that file.
>>
>> Before EFS, I'd use the FileBuffers facade to get the
>> TextFileBufferManager. I could then call the getTextFileBuffer(IPath)
>> method to get an ITextFileBuffer (being sure to connect to the resource
>> pointed by the IPath first).
>>
>> So how can I get an ITextFileBuffer given a IFileStore?
>
> Use new Path(yourFileStore.toURI().getPath());

What if the file from the file store doesn't correspond to a local file?
I think IPaths can only refer to files on the local file system. For
example, if my fileStore gives an EFS-view of the contents of the database,
there doesn't exist an IPath which can accurately point to the various rows
and tables that make up the content of that file.

- Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #304917 is a reply to message #304864] Mon, 19 June 2006 10:19 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Oliver Wong wrote:

>
> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
> news:e6tlcm$h5h$1@utils.eclipse.org...
>
>> Oliver Wong wrote:
>>
>>> Sorry if this is posted to the wrong newsgroup. I couldn't find
>>> one which is specific to the Eclipse resource API.
>>>
>>> Basically, I'd like to use the new Eclipse File System (EFS)
>>> along with ITextFileBuffers. I can't find a way to do this, however.
>>>
>>> When using the EFS, it looks like I'm supposed to use the
>>> fileSystem's getStore(URI) method to get an instance of IFileStore
>>> which represents a file in some file system. From here, I don't know
>>> what I'm supposed to do to get an ITextFileBuffer representing the
>>> contents of that file.
>>>
>>> Before EFS, I'd use the FileBuffers facade to get the
>>> TextFileBufferManager. I could then call the
>>> getTextFileBuffer(IPath) method to get an ITextFileBuffer (being
>>> sure to connect to the resource pointed by the IPath first).
>>>
>>> So how can I get an ITextFileBuffer given a IFileStore?
>>
>>
>> Use new Path(yourFileStore.toURI().getPath());
>
>
> What if the file from the file store doesn't correspond to a local
> file?

The current file buffer support is for workspace and local Java files
only. We might provide more for 3.3.

Dani

> I think IPaths can only refer to files on the local file system. For
> example, if my fileStore gives an EFS-view of the contents of the
> database, there doesn't exist an IPath which can accurately point to
> the various rows and tables that make up the content of that file.
>
> - Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #304983 is a reply to message #304917] Tue, 20 June 2006 16:03 Go to previous messageGo to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:e75tng$e2d$3@utils.eclipse.org...
> Oliver Wong wrote:
>
>> What if the file from the file store doesn't correspond to a local
>> file?
>
> The current file buffer support is for workspace and local Java files
> only. We might provide more for 3.3.

Okay, thank you.

- Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #304990 is a reply to message #304917] Tue, 20 June 2006 18:16 Go to previous messageGo to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:e75tng$e2d$3@utils.eclipse.org...
>
> The current file buffer support is for workspace and local Java files
> only. We might provide more for 3.3.

If I'd like to monitor progress on this issue, is there a website,
mailing list, IRC channel, or something else that I could track? I'm
wondering whether IFile and IPath will be deprecated in favour of IFileStore
and URI respectively, for example. I'd like to know the overal design
direction of this part of the API.

- Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #305009 is a reply to message #304990] Wed, 21 June 2006 08:28 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Oliver Wong wrote:

> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
> news:e75tng$e2d$3@utils.eclipse.org...
>
>>
>> The current file buffer support is for workspace and local Java files
>> only. We might provide more for 3.3.
>
>
> If I'd like to monitor progress on this issue, is there a website,
> mailing list, IRC channel, or something else that I could track? I'm
> wondering whether IFile and IPath will be deprecated in favour of
> IFileStore and URI respectively, for example. I'd like to know the
> overal design direction of this part of the API.

There's currently no enhancement request for this and hence you cannot
add yourself to the cc-list. You could file such a request yourself.

Dani

>
> - Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #305019 is a reply to message #305009] Wed, 21 June 2006 13:58 Go to previous messageGo to next message
Oliver Wong is currently offline Oliver WongFriend
Messages: 47
Registered: July 2009
Member
"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:e7avvh$j47$1@utils.eclipse.org...
> Oliver Wong wrote:
>
>> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
>> news:e75tng$e2d$3@utils.eclipse.org...
>>
>>>
>>> The current file buffer support is for workspace and local Java files
>>> only. We might provide more for 3.3.
>>
>>
>> If I'd like to monitor progress on this issue, is there a website,
>> mailing list, IRC channel, or something else that I could track? I'm
>> wondering whether IFile and IPath will be deprecated in favour of
>> IFileStore and URI respectively, for example. I'd like to know the overal
>> design direction of this part of the API.
>
> There's currently no enhancement request for this and hence you cannot add
> yourself to the cc-list. You could file such a request yourself.

Thanks again. In case anyone else is interested, I've filed the RFE.
It's at https://bugs.eclipse.org/bugs/show_bug.cgi?id=148034

- Oliver
Re: How can I get an ITextFileBuffer given a IFileStore? [message #305024 is a reply to message #305019] Wed, 21 June 2006 15:47 Go to previous message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

Oliver Wong wrote:
>
> Thanks again. In case anyone else is interested, I've filed the RFE.
> It's at https://bugs.eclipse.org/bugs/show_bug.cgi?id=148034

A different bug has been created for this:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=148057.
--
Previous Topic:Detached Views
Next Topic:problem with a feature
Goto Forum:
  


Current Time: Tue Apr 16 21:14:20 GMT 2024

Powered by FUDForum. Page generated in 0.05809 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top