de.smartics.maven.util.eclipse
Class WorkspaceUtils

Package class diagram package WorkspaceUtils
java.lang.Object
  extended by de.smartics.maven.util.eclipse.WorkspaceUtils

public final class WorkspaceUtils
     
     
extends Object

This utility class provides functions that deal with the eclipse workspace useful for Maven plugins.

Author:
Robert Reiner

Method Summary
static Set<String> fetchMavenProjectIds(MavenContext context, File workspaceDir, Set<String> includes, Set<String> excludes, boolean filterSubprojects)
          Returns the set of IDs of Maven projects found in the given workspace directory.
static Set<MavenProject> fetchMavenProjects(MavenContext context, File workspaceDir, Set<String> includes, Set<String> excludes)
          Returns the set of Maven projects found in the given workspace directory.
static Set<MavenProject> fetchMavenProjects(MavenContext context, File workspaceDir, Set<String> includes, Set<String> excludes, boolean filterSubprojects)
          Returns the set of Maven projects found in the given workspace directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fetchMavenProjects

public static Set<MavenProject> fetchMavenProjects(MavenContext context,
                                                   File workspaceDir,
                                                   Set<String> includes,
                                                   Set<String> excludes)
Returns the set of Maven projects found in the given workspace directory.

This method looks for POM files in the root directory (named pom.xml). If it finds one this will be read and added to the set if it provides a group and artifact identifier.

If it references submodules this references will not be followed. Submodules may, however, be found by other means, that is they are not especially excluded.

Parameters:
context - provides information required by this service.
workspaceDir - the workspace directory to search POM files.
includes - the set of directories (not pom.xml files) as Strings to include in the search. May be and should be null in which case only the direct contents of the workspace directories are scanned.
excludes - the set of excludes as Strings to exclude from search. May be null in which case nothing is excluded.
Returns:
the set of MavenProject projects found.

fetchMavenProjects

public static Set<MavenProject> fetchMavenProjects(MavenContext context,
                                                   File workspaceDir,
                                                   Set<String> includes,
                                                   Set<String> excludes,
                                                   boolean filterSubprojects)
Returns the set of Maven projects found in the given workspace directory.

This method looks for POM files in the root directory (named pom.xml). If it finds one this will be read and added to the set if it provides a group and artifact identifier.

If it references submodules this references will not be followed.

Parameters:
context - provides information required by this service.
workspaceDir - the workspace directory to search POM files.
includes - the set of directories (not pom.xml files) as Strings to include in the search. May be and should be null in which case only the direct contents of the workspace directories are scanned.
excludes - the set of excludes as Strings to exclude from search. May be null in which case nothing is excluded.
filterSubprojects - if this flag is set to true sub projects (referenced as modules from a project) are removed from the list of projects, otherwise the returned set of projects is not filtered.
Returns:
the set of MavenProject projects found.

fetchMavenProjectIds

public static Set<String> fetchMavenProjectIds(MavenContext context,
                                               File workspaceDir,
                                               Set<String> includes,
                                               Set<String> excludes,
                                               boolean filterSubprojects)
Returns the set of IDs of Maven projects found in the given workspace directory.

This method looks for POM files in the root directory (named pom.xml). If it finds one this will be read and added to the set if it provides a group and artifact identifier.

If it references submodules this references will not be followed.

Parameters:
context - provides information required by this service.
workspaceDir - the workspace directory to search POM files.
includes - the set of directories (not pom.xml files) as Strings to include in the search. May be and should be null in which case only the direct contents of the workspace directories are scanned.
excludes - the set of excludes as Strings to exclude from search. May be null in which case nothing is excluded.
filterSubprojects - if this flag is set to true sub projects (referenced as modules from a project) are removed from the list of projects, otherwise the returned set of projects is not filtered.
Returns:
the set of project IDs ( Strings) found.


Copyright © 2006-2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.