Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make the context path conigurable using web-ide.conf.
Signed-off-by: Chris McGee <sirnewton_01@yahoo.ca>
  • Loading branch information
sirnewton01 committed Jul 23, 2014
1 parent aa64da6 commit c393901
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Expand Up @@ -17,6 +17,8 @@
import static org.eclipse.orion.server.configurator.configuration.ConfigurationFormat.SSL_PASSWORD;
import static org.eclipse.orion.server.configurator.configuration.ConfigurationFormat.SSL_PROTOCOL;

import org.eclipse.orion.server.core.PreferenceHelper;

import java.util.Dictionary;
import java.util.Hashtable;
import org.eclipse.core.runtime.IStatus;
Expand All @@ -28,7 +30,6 @@
import org.eclipse.orion.server.configurator.configuration.ConfigurationFormat;
import org.eclipse.orion.server.core.LogHelper;
import org.eclipse.orion.server.core.ServerConstants;

import java.io.File;
import java.io.IOException;
import org.eclipse.equinox.app.IApplication;
Expand Down Expand Up @@ -65,7 +66,12 @@ public Object start(IApplicationContext context) throws Exception {

Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put(JettyConstants.CONTEXT_SESSIONINACTIVEINTERVAL, new Integer(4 * 60 * 60)); // 4 hours
//properties.put(JettyConstants.CONTEXT_PATH, "/cc");

String contextPath = PreferenceHelper.getString(ServerConstants.CONFIG_CONTEXT_PATH, null);
if (contextPath != null) {
properties.put(JettyConstants.CONTEXT_PATH, contextPath);
}

if (httpsEnabled) {
LogHelper.log(new Status(IStatus.INFO, ConfiguratorActivator.PI_CONFIGURATOR, "Https is enabled", null)); //$NON-NLS-1$

Expand Down
Expand Up @@ -183,6 +183,12 @@ public class ServerConstants {
* list of host names.
*/
public static final String CONFIG_SITE_VIRTUAL_HOSTS = "orion.site.virtualHosts"; //$NON-NLS-1$

/**
* The name of a configuration property specifying the context path to use
* for the server (e.g. /code).
*/
public static final String CONFIG_CONTEXT_PATH = "orion.context.path";

/**
* The bundle ID of the server core.
Expand Down

0 comments on commit c393901

Please sign in to comment.