org.netbeans.modules.project.ant/1 1.12.22

org.netbeans.spi.project.support.ant
Class ProjectGenerator

java.lang.Object
  extended by org.netbeans.spi.project.support.ant.ProjectGenerator

public class ProjectGenerator
extends Object

Utilities to create new Ant-based projects on disk.


Method Summary
static AntProjectHelper createProject(FileObject directory, String type)
          Create a new Ant-based project on disk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createProject

public static AntProjectHelper createProject(FileObject directory,
                                             String type)
                                      throws IOException,
                                             IllegalArgumentException
Create a new Ant-based project on disk. It will initially be only minimally configured - just a skeleton project.xml. It will be marked as modified.

In order to fill in various details of it, call normal methods on the returned helper object, then save the project when you are done. (You can use ProjectManager to find the project object to be saved.)

No build-impl.xml will be created immediately; once you save the project changes, it will be created. If you wish to create a top-level build.xml use GeneratedFilesHelper.generateBuildScriptFromStylesheet(java.lang.String, java.net.URL) after (or while) saving the project.

Acquires write access. But you are advised to acquire a write lock for the entire operation of creating, configuring, and saving the new project, and creating its initial build.xml.

Parameters:
directory - the main project directory to create it in (see AntProjectHelper.getProjectDirectory())
type - a unique project type identifier (see AntBasedProjectType.getType())
Returns:
an associated helper object
Throws:
IOException - if there is a problem physically creating the project
IllegalArgumentException - if the project type does not match a registered Ant-based project type factory or if the directory is already recognized as some kind of project or if the new project on disk is recognized by some other factory

org.netbeans.modules.project.ant/1 1.12.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.