How to add programmatically a source directory to a project

[email protected]
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
It is easy to recover programmatically the list of source directories
of a given project through org.netbeans.api.project with the next call:
ProjectUtils.getSources(project);.

But I didn't find an API that enable to add a source directory to a
project. In my case, it will always be an ant-based or maven-based J2SE
project.

Is there an API for doing such a thing or is there a turnaround?

Thanks for your help.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.