Re: getting to ProjectMember from SourceElement

Svata Dedic <[email protected]> 31 Jul 2003 08:23:29 +0200
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
On Thu, 2003-07-31 at 07:09, Peter Wisnovsky wrote:

> I do notice that in the Project.find docs it says that if you pass a
> file object, "if FileObject lies on filesystem of some project then
> this project is returned, otherwise it returns null"; moreover that
> projectmember.find is equivelent to using this. I inferred from this
Maybe bad wording; internally a .project file is expanded into a
FileSystem and project-related information (settings, project structure,
references to outside entities) are stored on that filesystem. It's just
like mf-layer.xml; however writable at runtime.
So if you pass in a FileObject from that FileSystem - that means the
FileObject represents some project artifact or some persistent storage
of a project setting, you'll get the owning Project.

Regular files, which are lying on your harddrive, can be included into
zero, one or more projects, so you can't get one Project - that's what
is findAll() for. If it returns more than one entry, your application
logic must decide which of the Projects is "the one".

-Svata