|
Re: Ecore model for filesystems [message #724965 is a reply to message #724734] |
Tue, 13 September 2011 14:57 |
Ed Merks 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 |
Mirko Raner 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.
|
|
|
Powered by
FUDForum. Page generated in 0.03855 seconds