Saves the application bindings into the DM's directory.
@param app a non-null application
@param configurationDirectory the DM's configuration directory
348818
public static void saveApplicationBindings( Application app ) {

		File descDir = new File( app.getDirectory(), Constants.PROJECT_DIR_DESC );
		File appBindingsFile = new File( descDir, APP_BINDINGS_FILE );

		// Convert the bindings map
		Map<String,String> format = new HashMap<> ();
		for( Map.Entry<String,Set<String>> entry : app.getApplicationBindings().entrySet()) {
			String s = Utils.format( entry.getValue(), ", " );
			format.put( entry.getKey(), s );
		}

		// Save it
		Properties props = new Properties();
		props.putAll( format );

		try {
			Utils.createDirectory( descDir );
			Utils.writePropertiesFile( props, appBindingsFile );

		} catch( IOException e ) {
			Logger logger = Logger.getLogger( ConfigurationUtils.class.getName());
			logger.severe( "Failed to save application bindings for " + app + ". " + e.getMessage());
			Utils.logException( logger, e );
		}
	}
915034
private void configureDefaultContextPath(DefaultContextPath dcp) {
        String methodName = "configureDefaultContextPath";
        String defaultContextPath = dcp.getValue();

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName + ": defaultContextPath --> " + defaultContextPath);
        }

        if (defaultContextPath != null && !defaultContextPath.isEmpty()) {
            webAppConfiguration.setDefaultContextPath(defaultContextPath);
        }
    }
1015242
public static void writeConfigFile(File configFile, File searchDir) throws SQLException, IOException {
		writeConfigFile(configFile, searchDir, false);
	}
985396
public static Map<String, String> getLdapSettingsForApp(App app) {
		Map<String, String> ldapSettings = new HashMap<>();
		if (app != null) {
			ldapSettings.put("security.ldap.server_url", "ldap://localhost:8389/");
			ldapSettings.put("security.ldap.active_directory_domain", "");
			ldapSettings.put("security.ldap.base_dn", "dc=springframework,dc=org");
			ldapSettings.put("security.ldap.bind_dn", "");
			ldapSettings.put("security.ldap.bind_pass", "");
			ldapSettings.put("security.ldap.user_search_base", "");
			ldapSettings.put("security.ldap.user_search_filter", "(cn={0})");
			ldapSettings.put("security.ldap.user_dn_pattern", "uid={0},ou=people");
			ldapSettings.put("security.ldap.password_attribute", "userPassword");
			//ldapSettings.put("security.ldap.compare_passwords", "false"); //don't remove comment
			Map<String, Object> settings = app.getSettings();
			for (Map.Entry<String, String> entry : ldapSettings.entrySet()) {
				if (settings.containsKey(entry.getKey())) {
					entry.setValue(settings.get(entry.getKey()) + "");
				} else if (app.isRootApp()) {
					entry.setValue(Config.getConfigParam(entry.getKey(), entry.getValue()));
				}
			}
		}
		return ldapSettings;
	}
1156861
public static void createDirectory(final String directory) {
        if (directory == null) return;
        final File f = new File(directory);
        if (!f.isDirectory()) {
            if (!f.mkdir()) throw new RuntimeException("couldn't create "
                    + directory);
        }
    }
239545
public static ApplicationProperties configure(Application app,
			ApplicationProperties config) {
		if (properties != null) {
			throw new ApplicationConfigurationException(
					"re-configure ApplicationProperties not allowed.");
		}
		properties = config;
		return properties;
	}
1130617
public void addToApplications(final Application application) {
		if (null == getApplications()) {
			setApplications(new java.util.TreeSet<Application>());
		}
		getApplications().add(application);
	}
228232
private void initializeApplication(ApplicationDefinition currAppDef, ApplicationDefinition appDef) {
        getStorageService(appDef).initializeApplication(currAppDef, appDef);
        storeApplicationSchema(appDef);
    }
1001622
public void addApplication(Application app) {
        appNameApplicationMap.put(app.getName().toUpperCase(Locale.ROOT), app);
        addInstancesToVIPMaps(app, this.virtualHostNameAppMap, this.secureVirtualHostNameAppMap);
        applications.add(app);
    }
529854
final protected function resolveApplicationBindings($app): void
    {
        foreach ($this->overrideApplicationBindings($app) as $original => $replacement) {
            $app->bind($original, $replacement);
        }
    }
792955
def init_config(self, app):
        
        config_apps = ['REST_', 'CORS_', ]
        for k in dir(config):
            if any([k.startswith(prefix) for prefix in config_apps]):
                app.config.setdefault(k, getattr(config, k))
610192
public static void initialise(@NonNull Application app, @NonNull ComapiConfig config, Callback<ComapiClient> callback) {

        String error = checkIfCanInitialise(app, config, false);
        if (!TextUtils.isEmpty(error) && callback != null) {
            callback.error(new Exception(error));
        }

        ComapiClient client = new ComapiClient(config);
        CallbackAdapter adapter = config.getCallbackAdapter() != null ? config.getCallbackAdapter() : new CallbackAdapter();
        client.initialise(app, adapter, callback);
    }
542359
public void setCompileDirectory(String directory) {
        if (directory != null && directory.trim().length() > 0) {
            File file = new File(directory);
            if (file.exists() || file.mkdirs()) {
                this.compileDirectory = file;
            }
        }
    }
901310
public void removeApplication(Application app) {
        this.appNameApplicationMap.remove(app.getName().toUpperCase(Locale.ROOT));
        this.applications.remove(app);
    }
167031
protected void onConfigure(final WebApplication application)
	{
		set(application, this);
		ApplicationExtensions.setDefaultDebugSettingsForDevelopment(application);
		// Adds the references from source code to the browser to reference in eclipse....
		// If you want to add WicketSource capabilities overwrite this method with a super call and
		// add the following...
		// WicketSource.configure(application);

		application.getMarkupSettings().setStripComments(false);
		application.getMarkupSettings().setCompressWhitespace(false);
		application.getMarkupSettings().setStripWicketTags(false);

	}
906828
static void generateConfigFile(String configFilePath) throws ConfigurationException {
        String fileExtention = FilenameUtils.getExtension(configFilePath);
        ConfigProvider<Configuration> provider = getProviderByFileExtention(fileExtention);
        if (!AuditUtil.isFileExists(configFilePath)) {
            provider.generateConfig(Configuration.DEFAULT, configFilePath);
        }
    }
180187
public final void setDirectory(final String directory) {
        if (SwingUtilities.isEventDispatchThread()) {
            setDirectoryIntern(directory);
        } else {
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
                        setDirectoryIntern(directory);
                    }
                });
            } catch (final Exception ex) {
                ignore();
            }
        }
    }