Class ProjectUtil
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.projects.ProjectUtil
-
public class ProjectUtil extends Object
Useful static functions.- Since:
- 8.0
- Author:
- Leonid Bushuev from JetBrains
-
-
Constructor Summary
Constructors Constructor Description ProjectUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckNoCycle(ProjectEx project, String newParentExternalId)If you change this method, please note that passed project is expected to be not added to model yet.static SProjectfindFirstNonVirtualParent(SProject project)static Set<String>getBuildTypesInternalIds(Collection<? extends BuildTypeIdentity> buildTypes)static SProjectgetCommonParentProject(Collection<SProject> projects)static Set<String>getProjectParentsAndChildrenInternalIds(SProject project)Collects internal identifiers of the given porjects, all its parent projects and all nested subprojects transitively.static Set<String>getProjectSelfAndChildrenInternalIds(SProject project)Collects internal identifiers of the given projects and all nested subprojects transitively.static Set<String>getProjectsInternalIds(Collection<? extends BuildProject> projects)Converts a collection of projects to a set of their internal ids.static List<SProject>getProjectWithSubProjects(SProject project)Returns the given project with all subprojects transitively.static StringmakeDeletedProjectDirectoryName(String projectExtId, String projectIntId)static StringmakeDeletedProjectDirectoryName(BuildProject project)static voidvalidateProjectName(String name)
-
-
-
Method Detail
-
validateProjectName
public static void validateProjectName(@NotNull String name) throws InvalidNameException- Throws:
InvalidNameException
-
checkNoCycle
public static void checkNoCycle(@NotNull ProjectEx project, @NotNull String newParentExternalId) throws CyclicDependencyExceptionIf you change this method, please note that passed project is expected to be not added to model yet. That means, for example, that no other project can return passed project as result ofSProject.getParentProject()method call. But some project can return passed project external id as result ofBuildProject.getParentProjectExternalId()method call.- Throws:
CyclicDependencyException
-
makeDeletedProjectDirectoryName
@NotNull public static String makeDeletedProjectDirectoryName(@NotNull BuildProject project)
-
makeDeletedProjectDirectoryName
@NotNull public static String makeDeletedProjectDirectoryName(@NotNull String projectExtId, @NotNull String projectIntId)
-
getProjectWithSubProjects
@NotNull public static List<SProject> getProjectWithSubProjects(@NotNull SProject project)
Returns the given project with all subprojects transitively.- Parameters:
project-- Returns:
- Since:
- 8.0
-
getProjectsInternalIds
@NotNull public static Set<String> getProjectsInternalIds(@NotNull Collection<? extends BuildProject> projects)
Converts a collection of projects to a set of their internal ids.- Parameters:
projects- collection of projects which ids to return.- Returns:
- set of internal ids.
- Since:
- 8.0
-
getBuildTypesInternalIds
@NotNull public static Set<String> getBuildTypesInternalIds(@NotNull Collection<? extends BuildTypeIdentity> buildTypes)
-
getProjectParentsAndChildrenInternalIds
@NotNull public static Set<String> getProjectParentsAndChildrenInternalIds(@NotNull SProject project)
Collects internal identifiers of the given porjects, all its parent projects and all nested subprojects transitively.- Parameters:
project- the project.- Returns:
- set of ids.
-
getProjectSelfAndChildrenInternalIds
@NotNull public static Set<String> getProjectSelfAndChildrenInternalIds(@NotNull SProject project)
Collects internal identifiers of the given projects and all nested subprojects transitively.- Parameters:
project- the project.- Returns:
- set of ids.
-
getCommonParentProject
@NotNull public static SProject getCommonParentProject(@NotNull Collection<SProject> projects)
-
-