Skip to main content


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: 125
Registered: July 2009
Location: New York City, NY
Senior 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: 33142
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
>


Ed Merks
Professional Support: https://www.macromodeling.com/
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: 125
Registered: July 2009
Location: New York City, NY
Senior 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: Fri Apr 26 13:33:49 GMT 2024

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

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

Back to the top