Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Ecore model for filesystems
icon5.gif  Ecore model for filesystems [message #724734] Tue, 13 September 2011 02:10 Go to next message
Mirko Raner is currently offline Mirko RanerFriend
Messages: 79
Registered: July 2009
Location: San Diego, CA
Member
Hi all,

is there an existing Ecore model that models a filesystem? I'm looking for a model that describes concepts like root, file, directory, etc. and that can be (lazily) populated from the real file system. The idea is that a call to ResourceSet.createResource("file:/home/folder/file.txt") would create a resource that represents that file.
It seems fairly easy to implement, but if someone already did that sort of work I'd like to leverage that.

Thanks,

Mirko
Re: Ecore model for filesystems [message #724965 is a reply to message #724734] Tue, 13 September 2011 14:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26289
Registered: July 2009
Senior Member
Mirko,

Comments below.

On 12/09/2011 7:10 PM, Mirko Raner wrote:
> Hi all,
>
> is there an existing Ecore model that models a filesystem? I'm looking
> for a model that describes concepts like root, file, directory, etc.
> and that can be (lazily) populated from the real file system.
I'm not sure I recall there being one.
> The idea is that a call to
> ResourceSet.createResource("file:/home/folder/file.txt") would create
> a resource that represents that file.
Well, there is already such a method but it create and EMF Resource
which sounds different from what you want.
> It seems fairly easy to implement, but if someone already did that
> sort of work I'd like to leverage that.
>
> Thanks,
>
> Mirko
>
Re: Ecore model for filesystems [message #725070 is a reply to message #724965] Tue, 13 September 2011 20:48 Go to previous message
Mirko Raner is currently offline Mirko RanerFriend
Messages: 79
Registered: July 2009
Location: San Diego, CA
Member
Thanks for the hints, Ed. I'll just create my own little ecore model then.
You're right that I have somewhat different semantics in mind for the createResource(...). By calling createResource("file:/home/folder/") I want to create a File object representing a file on disk, which I can then query for its parent folder, directory contents (if it's a directory), etc. The default implementation of createResource(...) will try to read the specified file and attempt to deserialize it as a model, which, as you've stated, is indeed not what I want. I think overloading the "file:" URI scheme is not a good idea here, though it would come in handy in other areas of my project. Probably I should come up with my own "filesystem:" URI scheme and introduce a custom URIConverter to hook it up.
Previous Topic:generate code from ecore file in standalone application.
Next Topic:Using generated code to calculate in standalone application
Goto Forum:
  


Current Time: Mon Dec 22 15:48:13 GMT 2014

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

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