All Downloads are FREE. Search and download functionalities are using the official Maven repository.

protoj.lang.internal.sample.snippet.UseCaseProfile Maven / Gradle / Ivy

The newest version!
package protoj.lang.internal.sample.snippet;

import java.io.File;

import protoj.lang.StandardProject;

/**
 * A code fragment used to demonstrate configuring a project with profiles.
 * 
 * @author Ashley Williams
 * 
 */
public final class UseCaseProfile {
	/**
	 * Enables the specified project to be configured either from a directory
	 * and from a network address via scp. Usually only one protocol would be
	 * chosen in a real project.
	 * 
	 * @param project
	 */
	public void addConfig(StandardProject project) {

		// 1. Enable project configuration from a directory on a mounted share.
		//
		// In this example the profile home directory is under the project home
		// directory. All profiles are simply subdirectories directly underneath
		// and are referred to by name when applying the dirconf command.

		File home = new File(System.getProperty("user.home"), ".acme");
		project.initDirConfig(home);

		// 2. Enable project configuration from a directory on the network.
		//
		// In this example the profile home url is located on another machine
		// that can be reached via ssh. All profiles are simply subdirectories
		// directly underneath and are referred to by name when applying the
		// scpconf command.

		String url = "configuser@host:~/allprofiles";
		project.initScpConfig(url);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy