public IApplication createApplication(final String name, final IStandaloneCartridge cartridge,
final ApplicationScale scale, final IGearProfile gearProfile, String initialGitUrl, int timeout,
Map<String, String> environmentVariables, IEmbeddableCartridge... cartridges)
throws OpenShiftException {
if (name == null) {
throw new OpenShiftException("Application name is mandatory but none was given.");
}
// this would trigger lazy loading list of available applications.
// this is needed anyhow since we're adding the new app to the list of
// available apps
if (hasApplicationByName(name)) {
throw new OpenShiftException("Application with name \"{0}\" already exists.", name);
}
ApplicationResourceDTO applicationDTO =
new CreateApplicationRequest().execute(
name, cartridge, scale, gearProfile, initialGitUrl, timeout, environmentVariables, cartridges);