src/org/ohmage/util/CookieUtils.java
public static URL buildServerRootUrl() throws DomainException {
		// Create a string builder to use to build the URL.
		StringBuilder urlBuilder = new StringBuilder();
		
		// Determine if HTTPS is being used on this server.
		try {
			if(StringUtils.decodeBoolean(
				PreferenceCache.instance().lookup(
					PreferenceCache.KEY_SSL_ENABLED))) {
				urlBuilder.append("https://");
			}
			else {
				urlBuilder.append("http://");
			}
		}
		catch(CacheMissException e) {
			throw
				new DomainException("Error reading the SSL enabled value.", e);
		}
		
		// Append the server's fully qualified domain name.
		try {
			urlBuilder.append(
				PreferenceCache.instance().lookup(
					PreferenceCache.KEY_FULLY_QUALIFIED_DOMAIN_NAME));
		}
		catch(CacheMissException e) {
			throw
				new DomainException(
					"Error reading the fully qualified domain name value.",
					e);
		}
		
		try {
			return new URL(urlBuilder.toString());
		}
		catch(MalformedURLException e) {
			throw new DomainException("The URL is not valid.");
		}
	}
/**
	 * Creates a new base URL for the current domain with no path. 
	 * 
	 * @return The base URL for the current domain without a path.
	 * 
	 * @throws DomainException There was an error creating the URL.
	 */
Creates a new base URL for the current domain with no path.

@return The base URL for the current domain without a path.

@throws DomainException There was an error creating the URL.
Creates a new base URL for the current domain with no path . @return The base URL for the current domain without a path . @throws DomainException There was an error creating the URL .
public static URL buildServerRootUrl() throws DomainException {
		StringBuilder urlBuilder = new StringBuilder();
		try {
			if(StringUtils.decodeBoolean(
				PreferenceCache.instance().lookup(
					PreferenceCache.KEY_SSL_ENABLED))) {
				urlBuilder.append("https://");
			}
			else {
				urlBuilder.append("http://");
			}
		}
		catch(CacheMissException e) {
			throw
				new DomainException("Error reading the SSL enabled value.", e);
		}
		try {
			urlBuilder.append(
				PreferenceCache.instance().lookup(
					PreferenceCache.KEY_FULLY_QUALIFIED_DOMAIN_NAME));
		}
		catch(CacheMissException e) {
			throw
				new DomainException(
					"Error reading the fully qualified domain name value.",
					e);
		}
		try {
			return new URL(urlBuilder.toString());
		}
		catch(MalformedURLException e) {
			throw new DomainException("The URL is not valid.");
		}
	}
public static URL buildServerRootUrl ( ) throws DomainException { StringBuilder urlBuilder = new StringBuilder ( ) ; try { if ( StringUtils . decodeBoolean ( PreferenceCache . instance ( ) . lookup ( PreferenceCache . KEY_SSL_ENABLED ) ) ) { urlBuilder . append ( "https://" ) ; } else { urlBuilder . append ( "http://" ) ; } } catch ( CacheMissException e ) { throw new DomainException ( "Error reading the SSL enabled value." , e ) ; } try { urlBuilder . append ( PreferenceCache . instance ( ) . lookup ( PreferenceCache . KEY_FULLY_QUALIFIED_DOMAIN_NAME ) ) ; } catch ( CacheMissException e ) { throw new DomainException ( "Error reading the fully qualified domain name value." , e ) ; } try { return new URL ( urlBuilder . toString ( ) ) ; } catch ( MalformedURLException e ) { throw new DomainException ( "The URL is not valid." ) ; } }
Creates a new base URL for the current domain with no path.
Creates a new base URL for the current domain with no path .
// Create a string builder to use to build the URL. // Determine if HTTPS is being used on this server. // Append the server's fully qualified domain name.