[85971] Add HTTP server adapter
diff --git a/plugins/org.eclipse.wst.server.http.core/.classpath b/plugins/org.eclipse.wst.server.http.core/.classpath
new file mode 100644
index 0000000..52165ec
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.wst.server.http.core/.cvsignore b/plugins/org.eclipse.wst.server.http.core/.cvsignore
new file mode 100644
index 0000000..33dd7de
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/.cvsignore
@@ -0,0 +1,6 @@
+bin
+temp.folder
+build.xml
+@dot
+src.zip
+javaCompiler...args
diff --git a/plugins/org.eclipse.wst.server.http.core/.project b/plugins/org.eclipse.wst.server.http.core/.project
new file mode 100644
index 0000000..c94c165
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.server.http.core</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..c8be432
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Fri Nov 10 17:11:35 HST 2006
+eclipse.preferences.version=1
+encoding/<project>=ISO-8859-1
diff --git a/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..31ca1b4
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,74 @@
+#Thu Mar 08 19:15:42 PST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=error
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=disabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=error
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=error
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=error
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.incompatibleJDKLevel=warning
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..a7cc1d0
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+#Fri Feb 23 21:11:52 EST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?>\n<templates/>
diff --git a/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..08a60e5
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,14 @@
+#Sat Apr 22 18:36:14 EDT 2006
+compilers.incompatible-environment=0
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.wst.server.http.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.http.core/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5f06d1e
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.wst.server.http.core;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.wst.server.http.core.internal.HttpCorePlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.wst.server.http.core.internal;x-friends:="org.eclipse.wst.server.http.ui",
+ org.eclipse.wst.server.http.core.internal.command;x-friends:="org.eclipse.wst.server.http.ui"
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.commands;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.wst.server.core;bundle-version="[1.0.204,2.0.0)"
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/plugins/org.eclipse.wst.server.http.core/about.html b/plugins/org.eclipse.wst.server.http.core/about.html
new file mode 100644
index 0000000..4ec5989
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/about.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>May 2, 2006</P>
+
+<H3>License</H3>
+
+<P>The Eclipse Foundation makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from the Eclipse Foundation, the 
+Content is being redistributed by another party ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the Redistributor’s license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
+
+</BODY>
+</HTML>
diff --git a/plugins/org.eclipse.wst.server.http.core/build.properties b/plugins/org.eclipse.wst.server.http.core/build.properties
new file mode 100644
index 0000000..af949f3
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/build.properties
@@ -0,0 +1,19 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = META-INF/,\
+               plugin.properties,\
+               .,\
+               plugin.xml,\
+               about.html
+bin.excludes = bin/**,\
+               @dot/**,\
+               temp.folder/**
+source.. = src/
diff --git a/plugins/org.eclipse.wst.server.http.core/plugin.properties b/plugins/org.eclipse.wst.server.http.core/plugin.properties
new file mode 100644
index 0000000..2d780b2
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/plugin.properties
@@ -0,0 +1,18 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+pluginName=HTTP Server Support
+providerName=Eclipse.org
+
+runtimeTypeHttpLabel=HTTP Server
+runtimeTypeHttpDescription=Publishes and runs projects on an HTTP server.
+
+httpServerType=HTTP Server
+httpServerDescription=Publishes and runs projects on an HTTP server.
diff --git a/plugins/org.eclipse.wst.server.http.core/plugin.xml b/plugins/org.eclipse.wst.server.http.core/plugin.xml
new file mode 100644
index 0000000..e86032a
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/plugin.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   	<extension point="org.eclipse.wst.server.core.runtimeTypes">
+	    <runtimeType
+	       id="org.eclipse.wst.server.http.runtime"
+	       name="%runtimeTypeHttpLabel"
+	       description="%runtimeTypeHttpDescription"
+	       class="org.eclipse.wst.server.http.core.internal.HttpRuntime">
+	       <moduleType
+	         types="PHP"
+	         versions="1.0"/>
+	       <moduleType
+	       	 types="wst.web"
+	       	 versions="1.0"/>
+	    </runtimeType>
+  	</extension>
+
+ 	<extension point="org.eclipse.wst.server.core.serverTypes">
+     <serverType
+       id="org.eclipse.wst.server.http"
+       name="%httpServerType"
+       description="%httpServerDescription"
+       supportsRemoteHosts="true"
+       runtime="true"
+       initialState="started"
+       hasConfiguration="false"
+       launchModes="run"
+       runtimeTypeId="org.eclipse.wst.server.http.runtime"
+       class="org.eclipse.wst.server.http.core.internal.HttpServer"
+       behaviourClass="org.eclipse.wst.server.http.core.internal.HttpServerBehaviour"/>
+  	</extension>
+
+  <extension point="org.eclipse.wst.server.core.runtimeLocators">
+    <runtimeLocator
+       id="org.eclipse.wst.server.http.runtime.locator"
+       typeIds="org.eclipse.wst.server.http.runtime"
+       class="org.eclipse.wst.server.http.core.internal.HttpRuntimeLocator"/>
+  </extension>
+
+  	<extension point="org.eclipse.wst.common.project.facet.core.runtimes">
+	    <runtime-component-type
+	       id="org.eclipse.wst.server.http"/>
+	    <runtime-component-version
+	       type="org.eclipse.wst.server.http"
+	       version="1.0"/>
+	    <supported>
+	      <runtime-component
+	         id="org.eclipse.wst.server.http"
+	         version="1.0"/>
+	      <facet
+	         id="wst.web"
+	         version="[1.0"/>
+	    </supported>
+  	</extension>
+
+  	<extension point="org.eclipse.jst.server.core.runtimeFacetMappings">
+	    <runtimeFacetMapping
+	      runtimeTypeId="org.eclipse.wst.server.http.runtime"
+	      runtime-component="org.eclipse.wst.server.http"
+	      version="1.0"/>
+  	</extension>
+
+   <extension point="org.eclipse.wst.server.core.launchableAdapters">
+      <launchableAdapter
+        id="com.ibm.etools.publishing.server.web"
+        class="org.eclipse.wst.server.http.core.internal.HttpLaunchableAdapterDelegate"/>
+   </extension>
+</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpCorePlugin.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpCorePlugin.java
new file mode 100644
index 0000000..1277685
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpCorePlugin.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+/**
+ * The HTTP server core plugin.
+ */
+public class HttpCorePlugin extends Plugin {
+	public static final String PLUGIN_ID = "org.eclipse.wst.server.http.core";
+
+	private static HttpCorePlugin plugin;
+
+	/**
+	 * The constructor
+	 */
+	public HttpCorePlugin() {
+		plugin = this;
+	}
+
+	/**
+	 * Returns the singleton instance of this plugin.
+	 * 
+	 * @return an instance
+	 */
+	public static HttpCorePlugin getInstance() {
+		return plugin;
+	}
+
+	/**
+	 * Return the install location preference.
+	 * 
+	 * @param id a runtime type id
+	 * @return the install location
+	 */
+	public static String getPreference(String id) {
+		return getInstance().getPluginPreferences().getString(id);
+	}
+
+	/**
+	 * Set the install location preference.
+	 * 
+	 * @param id the runtimt type id
+	 * @param value the location
+	 */
+	public static void setPreference(String id, String value) {
+		getInstance().getPluginPreferences().setValue(id, value);
+		getInstance().savePluginPreferences();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpLaunchableAdapterDelegate.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpLaunchableAdapterDelegate.java
new file mode 100644
index 0000000..6ab83f8
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpLaunchableAdapterDelegate.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
+import org.eclipse.wst.server.core.util.HttpLaunchable;
+import org.eclipse.wst.server.core.util.WebResource;
+
+public class HttpLaunchableAdapterDelegate extends LaunchableAdapterDelegate {
+	/*
+	 * @see LaunchableAdapterDelegate#getLaunchable(IServer, IModuleArtifact)
+	 */
+	public Object getLaunchable(IServer server, IModuleArtifact moduleArtifact) throws CoreException {
+		if (server == null || moduleArtifact == null)
+			return null;
+		
+		HttpServer server2 = (HttpServer) server.loadAdapter(HttpServer.class, null);
+		if (server2 == null)
+			return null;
+		
+		try {
+			URL url = server2.getModuleRootURL(moduleArtifact.getModule());
+			
+			if (moduleArtifact instanceof WebResource) {
+				WebResource resource = (WebResource) moduleArtifact;
+				String path = resource.getPath().toString();
+				
+				if (path.startsWith("/"))
+					path = path.substring(1);
+				url = new URL(url.toExternalForm() + "/" + path);
+			}
+			return new HttpLaunchable(url);
+		} catch (Exception e) {
+			Trace.trace(Trace.SEVERE, "Error in launchable adapter", e);
+		}
+		
+		return null;
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpRuntime.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpRuntime.java
new file mode 100644
index 0000000..4f23940
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpRuntime.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.model.RuntimeDelegate;
+/**
+ * 
+ */
+public class HttpRuntime extends RuntimeDelegate implements IHttpRuntimeWorkingCopy {
+	public static final String PROP_PUBLISH_LOCATION = "publishLocation";
+	public static final String PROP_PORT = "serverPort";
+	public static final String PROP_PREFIX = "prefixPath";
+	public static final String PROP_CAN_PUBLISH = "canPublish";
+	// public static final String PROP_BASE_URL = "baseURL";
+
+	public static final String ID = "org.eclipse.wst.server.http.runtime";
+
+	public HttpRuntime() {
+		// do nothing
+	}
+
+	public IStatus validate() {
+		return Status.OK_STATUS;
+	}
+
+	/**
+	 * @see RuntimeDelegate#setDefaults(IProgressMonitor)
+	 */
+	public void setDefaults(IProgressMonitor monitor) {
+		setPrefixPath("");
+		setPublishLocation("");
+		setPublishToDirectory(true);
+		setPort(80);
+	}
+
+	public String getPublishLocation() {
+		return getAttribute(PROP_PUBLISH_LOCATION, (String) null);
+	}
+
+	public void setPublishLocation(String location) {
+		setAttribute(PROP_PUBLISH_LOCATION, location);
+	}
+
+	public int getPort() {
+		return getAttribute(PROP_PORT, -1);
+	}
+
+	public String getPrefixPath() {
+		return getAttribute(PROP_PREFIX, (String) null);
+	}
+
+	public void setPort(int port) {
+		setAttribute(PROP_PORT, port);
+	}
+
+	public void setPrefixPath(String prefixPath) {
+		setAttribute(PROP_PREFIX, prefixPath);
+	}
+
+	public boolean publishToDirectory() {
+		return getAttribute(PROP_CAN_PUBLISH, false);
+	}
+
+	public void setPublishToDirectory(boolean canPublish) {
+		setAttribute(PROP_CAN_PUBLISH, canPublish);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpRuntimeLocator.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpRuntimeLocator.java
new file mode 100644
index 0000000..793f9b2
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpRuntimeLocator.java
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import java.io.File;
+import java.io.FileFilter;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.model.RuntimeLocatorDelegate;
+/**
+ * 
+ */
+public class HttpRuntimeLocator extends RuntimeLocatorDelegate {
+	protected static final String[] runtimeTypes = new String[] { HttpRuntime.ID };
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.server.core.model.IRuntimeFactoryDelegate#getKnownRuntimes()
+	 */
+	public void searchForRuntimes(IPath path, IRuntimeSearchListener listener,
+			IProgressMonitor monitor) {
+		searchForRuntimes2(path, listener, monitor);
+	}
+
+	protected static void searchForRuntimes2(IPath path, IRuntimeSearchListener listener,
+			IProgressMonitor monitor) {
+		File[] files = null;
+		if (path != null) {
+			File f = path.toFile();
+			if (f.exists())
+				files = f.listFiles();
+			else
+				return;
+		} else
+			files = File.listRoots();
+
+		if (files != null) {
+			int size = files.length;
+			int work = 100 / size;
+			int workLeft = 100 - (work * size);
+			for (int i = 0; i < size; i++) {
+				if (monitor.isCanceled())
+					return;
+				if (files[i] != null && files[i].isDirectory())
+					searchDir(listener, files[i], 4, monitor);
+				monitor.worked(work);
+			}
+			monitor.worked(workLeft);
+		} else
+			monitor.worked(100);
+	}
+
+	protected static void searchDir(IRuntimeSearchListener listener, File dir, int depth, IProgressMonitor monitor) {
+		if ("htdocs".equals(dir.getName())) {
+			IRuntimeWorkingCopy runtime = getRuntimeFromDir(dir.getParentFile(), monitor);
+			if (runtime != null) {
+				listener.runtimeFound(runtime);
+				return;
+			}
+		}
+
+		if (depth == 0)
+			return;
+
+		File[] files = dir.listFiles(new FileFilter() {
+			public boolean accept(File file) {
+				return file.isDirectory();
+			}
+		});
+		if (files != null) {
+			int size = files.length;
+			for (int i = 0; i < size; i++) {
+				if (monitor.isCanceled())
+					return;
+				searchDir(listener, files[i], depth - 1, monitor);
+			}
+		}
+	}
+
+	protected static IRuntimeWorkingCopy getRuntimeFromDir(File dir, IProgressMonitor monitor) {
+		for (int i = 0; i < runtimeTypes.length; i++) {
+			try {
+				IRuntimeType runtimeType = ServerCore.findRuntimeType(runtimeTypes[i]);
+				String absolutePath = dir.getAbsolutePath();
+				String id = absolutePath.replace(File.separatorChar, '_').replace(':', '-');
+				IRuntimeWorkingCopy runtime = runtimeType.createRuntime(id, monitor);
+				runtime.setName(dir.getName());
+				runtime.setLocation(new Path(absolutePath));
+				HttpRuntime wc = (HttpRuntime) runtime.loadAdapter(HttpRuntime.class, monitor);
+				// wc.setBaseURL("http://localhost");
+				wc.setPublishLocation(new Path(absolutePath).append("htdocs").toString());
+				IStatus status = runtime.validate(monitor);
+				if (status == null || status.getSeverity() != IStatus.ERROR)
+					return runtime;
+
+				Trace.trace(Trace.FINER, "False runtime found at " + dir.getAbsolutePath()
+						+ ": " + status.getMessage());
+			} catch (Exception e) {
+				Trace.trace(Trace.SEVERE, "Could not find runtime", e);
+			}
+		}
+		return null;
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpServer.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpServer.java
new file mode 100644
index 0000000..d8bd900
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpServer.java
@@ -0,0 +1,264 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import java.net.URL;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeType;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.wst.server.core.model.IURLProvider;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+/**
+ * Generic HTTP server.
+ */
+public class HttpServer extends ServerDelegate implements IURLProvider {
+	public static final String PROPERTY_BASE_URL = "base_url";
+	public static final String PROPERTY_URL_PREFIX = "url_prefix";
+	// public static final String DOCUMENT_ROOT = "document_root";
+	// public static final String PUBLISH = "publish";
+	public static final String PROPERTY_PORT = "port";
+	public static final String PROPERTY_PUB_DIR = "publish_directory";
+	public static final String ID = "org.eclipse.wst.server.http";
+
+	/**
+	 * HttpServer.
+	 */
+	public HttpServer() {
+		super();
+	}
+
+	protected void initialize() {
+		// do nothing
+	}
+
+	public HttpRuntime getHttpRuntime() {
+		if (getServer().getRuntime() == null)
+			return null;
+
+		return (HttpRuntime) getServer().getRuntime().loadAdapter(HttpRuntime.class, null);
+	}
+
+	public void importRuntimeConfiguration(IRuntime arg0, IProgressMonitor arg1) throws CoreException {
+		if (getHttpRuntime() != null) {
+			if (!getHttpRuntime().publishToDirectory()) {
+				setAttribute("auto-publish-setting", 1);
+			} else {
+				setAttribute("auto-publish-setting", 2);
+				setAttribute("auto-publish-time", 1);
+			}
+			setURLPrefix(getHttpRuntime().getPrefixPath());
+			setPort(getHttpRuntime().getPort());
+			setPublishDirectory(getHttpRuntime().getPublishLocation());
+		}
+	}
+
+	public String getBaseURL() {
+		return getAttribute(HttpServer.PROPERTY_BASE_URL, "");
+	}
+
+	public boolean dontPublish() {
+		return getAttribute("auto-publish-setting", "2").equals("1");
+	}
+
+	public void setBaseURL(String url) {
+		setAttribute(HttpServer.PROPERTY_BASE_URL, url);
+	}
+
+	// public void setDocumentRoot(String docRoot) {
+	// setAttribute(HttpServer.DOCUMENT_ROOT, docRoot);
+	// }
+
+	// public String getDocumentRoot() {
+	// return getAttribute(HttpServer.DOCUMENT_ROOT, "");
+	// }
+
+	// public boolean canPublish() {
+	// return getAttribute(HttpServer.PUBLISH, true);
+	// }
+
+	// public void setPublish(boolean publish) {
+	// setAttribute(HttpServer.PUBLISH, publish);
+	// }
+
+	/**
+	 * Return the root URL of this module.
+	 * 
+	 * @param module org.eclipse.wst.server.core.model.IModule
+	 * @return java.net.URL
+	 */
+	public URL getModuleRootURL(IModule module) {
+		try {
+			String base = getBaseURL();
+			if (base.equals(""))
+				base = "http://" + getServer().getHost();
+
+			int port = getPort();
+			if (port == 80)
+				return new URL(base + "/");
+			
+			return new URL(base + ":" + port + "/");
+		} catch (Exception e) {
+			Trace.trace(Trace.SEVERE, "Could not get root URL", e);
+			return null;
+		}
+	}
+
+	/*
+	 * Returns the child module(s) of this module.
+	 */
+	public IModule[] getChildModules(IModule[] module) {
+		return new IModule[0];
+	}
+
+	/*
+	 * Returns the root module(s) of this module.
+	 */
+	public IModule[] getRootModules(IModule module) throws CoreException {
+		return new IModule[] { module };
+	}
+
+	/**
+	 * Returns true if the given project is supported by this server, and false
+	 * otherwise.
+	 * 
+	 * @param add modules
+	 * @param remove modules
+	 * @return the status
+	 */
+	public IStatus canModifyModules(IModule[] add, IModule[] remove) {
+		return new Status(IStatus.OK, HttpCorePlugin.PLUGIN_ID, 0, Messages.canModifyModules, null);
+	}
+
+	public ServerPort[] getServerPorts() {
+		int port = getPort();
+		ServerPort[] ports = { new ServerPort("http", Messages.httpPort, port, "http") };
+		return ports;
+	}
+
+	public int getPort() {
+		return getAttribute(HttpServer.PROPERTY_PORT, 80);
+	}
+
+	public void setPort(int port) {
+		setAttribute(HttpServer.PROPERTY_PORT, port);
+	}
+
+	public void setURLPrefix(String prefix) {
+		setAttribute(HttpServer.PROPERTY_URL_PREFIX, prefix);
+	}
+
+	public String getURLPrefix() {
+		if (getHttpRuntime() != null)
+			return getAttribute(HttpServer.PROPERTY_URL_PREFIX, getHttpRuntime().getPrefixPath());
+		return getAttribute(HttpServer.PROPERTY_URL_PREFIX, "");
+	}
+
+	public static IServer createHttpServer(String serverName, String baseURL) {
+		String host = baseURL;
+		if (baseURL.startsWith("http://"))
+			host = host.substring(7);
+		int index = host.indexOf("/");
+		if (index != -1)
+			host = host.substring(0, index - 1);
+		index = host.indexOf(":");
+		if (index != -1)
+			host = host.substring(0, index - 1);
+
+		try {
+			NullProgressMonitor monitor = new NullProgressMonitor();
+			IRuntimeType runtimeType = ServerCore.findRuntimeType(HttpRuntime.ID);
+			IRuntimeWorkingCopy runtimeCopy = runtimeType.createRuntime(HttpRuntime.ID, monitor);
+			IRuntime runtime = runtimeCopy.save(true, monitor);
+			
+			IServerType serverType = ServerCore.findServerType(ID);
+			IServerWorkingCopy workingCopy = serverType.createServer(ID, null, runtime, monitor);
+			workingCopy.setName(serverName);
+			workingCopy.setHost(host);
+			
+			HttpServer hs = (HttpServer) workingCopy.loadAdapter(HttpServer.class, null);
+
+			hs.setBaseURL(baseURL);
+			hs.saveConfiguration(null);
+			return workingCopy.save(true, monitor);
+		} catch (Exception e) {
+			Trace.trace(Trace.SEVERE, "Error creating server", e);
+		}
+		
+		return null;
+	}
+
+	public static IServer findHttpServer(String id) {
+		IServer[] servers = ServerCore.getServers();
+		for (int i = 0; i < servers.length; i++) {
+			if (servers[i].getId().equals(id)) {
+				return servers[i];
+			}
+		}
+		return null;
+	}
+
+	public void setPublishDirectory(String pubDir) {
+		setAttribute(PROPERTY_PUB_DIR, pubDir);
+	}
+
+	public String getPublishDirectory() {
+		if (getHttpRuntime() != null)
+			return getAttribute(PROPERTY_PUB_DIR, getHttpRuntime().getPublishLocation());
+		return getAttribute(PROPERTY_PUB_DIR, "");
+	}
+
+	/*
+	 * public static void updateBaseURL(String id, String baseURL) {
+	 * updateBaseURL(checkForHttpServer(id), baseURL); }
+	 */
+
+	/*
+	 * public static void updateBaseURL(IServer server, String baseURL) { if
+	 * (server == null) return;
+	 * 
+	 * IServerWorkingCopy workingCopy = server.createWorkingCopy();
+	 * 
+	 * HttpServer as = (HttpServer) workingCopy.getAdapter(HttpServer.class); if
+	 * (as == null) as = (HttpServer) workingCopy.loadAdapter(HttpServer.class,
+	 * null);
+	 * 
+	 * String currentURL = as.getBaseURL();
+	 * 
+	 * if (currentURL.equals(baseURL)) return; as.setBaseURL(baseURL); try {
+	 * as.saveConfiguration(null); workingCopy.save(true, null); } catch
+	 * (CoreException e) { e.printStackTrace(); } }
+	 */
+
+	public void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws CoreException {
+		// do nothing
+	}
+
+	/**
+	 * Return a string representation of this object.
+	 * 
+	 * @return java.lang.String
+	 */
+	public String toString() {
+		return "HttpServer";
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpServerBehaviour.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpServerBehaviour.java
new file mode 100644
index 0000000..7f6a2ca
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/HttpServerBehaviour.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
+import org.eclipse.wst.server.core.util.IStaticWeb;
+import org.eclipse.wst.server.core.util.PublishUtil;
+/**
+ * Generic Http server.
+ */
+public class HttpServerBehaviour extends ServerBehaviourDelegate {
+	// the thread used to ping the server to check for startup
+	protected transient PingThread ping = null;
+
+	/**
+	 * HttpServer.
+	 */
+	public HttpServerBehaviour() {
+		super();
+	}
+
+	public void initialize(IProgressMonitor monitor) {
+		// do nothing
+	}
+
+	public HttpRuntime getHttpRuntime() {
+		if (getServer().getRuntime() == null)
+			return null;
+
+		return (HttpRuntime) getServer().getRuntime().loadAdapter(HttpRuntime.class, null);
+	}
+
+	public HttpServer getHttpServer() {
+		return (HttpServer) getServer().getAdapter(HttpServer.class);
+	}
+
+	protected void setServerStarted() {
+		setServerState(IServer.STATE_STARTED);
+	}
+
+	protected void publishServer(int kind, IProgressMonitor monitor) throws CoreException {
+		monitor = ProgressUtil.getMonitorFor(monitor);
+		monitor.done();
+
+		setServerPublishState(IServer.PUBLISH_STATE_NONE);
+	}
+
+	/*
+	 * Publishes the given module to the server.
+	 */
+	protected void publishModule(int kind, int deltaKind, IModule[] moduleTree, IProgressMonitor monitor) throws CoreException {
+		String contextRoot = null;
+		IModule module = moduleTree[moduleTree.length - 1]; 
+		IStaticWeb sw = (IStaticWeb) module.loadAdapter(IStaticWeb.class, monitor);
+		if (sw != null)
+			contextRoot = sw.getContextRoot();
+		else
+			contextRoot = module.getName();
+		
+		IPath to = new Path(getHttpServer().getPublishDirectory());
+		if (contextRoot != null && !contextRoot.equals(""))
+			to = to.append(contextRoot);
+		
+		IModuleResource[] res = getResources(moduleTree);
+		IStatus[] status = PublishUtil.publishSmart(res, to, monitor);
+		throwException(status);
+		
+		setModulePublishState(moduleTree, IServer.PUBLISH_STATE_NONE);
+	}
+
+	/**
+	 * Utility method to throw a CoreException based on the contents of a list of
+	 * error and warning status.
+	 * 
+	 * @param status a List containing error and warning IStatus
+	 * @throws CoreException
+	 */
+	private static void throwException(IStatus[] status) throws CoreException {
+		if (status == null)
+			return;
+		
+		if (status.length == 1)
+			throw new CoreException(status[0]);
+		
+		String message = Messages.errorPublish;
+		MultiStatus status2 = new MultiStatus(HttpCorePlugin.PLUGIN_ID, 0, status, message, null);
+		throw new CoreException(status2);
+	}
+
+	public void restart(String launchMode) throws CoreException {
+		setServerState(IServer.STATE_STOPPED);
+		setServerState(IServer.STATE_STARTED);
+	}
+
+	/**
+	 * Cleanly shuts down and terminates the server.
+	 * 
+	 * @param force <code>true</code> to kill the server
+	 */
+	public void stop(boolean force) {
+		setServerState(IServer.STATE_STOPPED);
+	}
+
+	/**
+	 * Terminates the server.
+	 */
+	protected void terminate() {
+		if (getServer().getServerState() == IServer.STATE_STOPPED)
+			return;
+		
+		try {
+			setServerState(IServer.STATE_STOPPING);
+			Trace.trace(Trace.FINER, "Killing the HTTP process");
+		} catch (Exception e) {
+			Trace.trace(Trace.SEVERE, "Error killing the process", e);
+		}
+	}
+
+	/**
+	 * Return a string representation of this object.
+	 * 
+	 * @return java.lang.String
+	 */
+	public String toString() {
+		return "HttpServer";
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/IHttpRuntimeWorkingCopy.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/IHttpRuntimeWorkingCopy.java
new file mode 100644
index 0000000..2812ff3
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/IHttpRuntimeWorkingCopy.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+public interface IHttpRuntimeWorkingCopy {
+	public void setPublishLocation(String location);
+
+	public void setPort(int port);
+
+	public void setPrefixPath(String prefixPath);
+
+	public String getPublishLocation();
+
+	public int getPort();
+
+	public String getPrefixPath();
+
+	public boolean publishToDirectory();
+
+	public void setPublishToDirectory(boolean canPublish);
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Messages.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Messages.java
new file mode 100644
index 0000000..1a6f293
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Messages.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+/**
+ * Translated messages.
+ */
+public class Messages extends NLS {
+	public static String configurationEditorActionModifyPort;
+	public static String errorPublish;
+	public static String canModifyModules;
+	public static String httpPort;
+
+	static {
+		NLS.initializeMessages(HttpCorePlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Messages.properties b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Messages.properties
new file mode 100644
index 0000000..f96e14d
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Messages.properties
@@ -0,0 +1,16 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+
+configurationEditorActionModifyPort=set port number
+errorPublish=Error during publish
+
+httpPort=HTTP Port
+canModifyModules=Web modules can be modified.
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/PingThread.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/PingThread.java
new file mode 100644
index 0000000..39360c3
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/PingThread.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import java.io.FileNotFoundException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.eclipse.wst.server.core.IServer;
+
+/**
+ * Thread used to ping server to test when it is started.
+ */
+public class PingThread {
+	// delay before pinging starts
+	private static final int PING_DELAY = 2000;
+
+	// delay between pings
+	private static final int PING_INTERVAL = 250;
+
+	// maximum number of pings before giving up
+	private int maxPings = 56; // total: 16 seconds + connection time
+
+	private boolean stop = false;
+
+	private String url;
+
+	private IServer server;
+
+	private HttpServerBehaviour behaviour;
+
+	/**
+	 * Create a new PingThread.
+	 * 
+	 * @param server
+	 * @param url
+	 * @param maxPings
+	 * @param behaviour
+	 */
+	public PingThread(IServer server, String url, int maxPings,
+			HttpServerBehaviour behaviour) {
+		super();
+		this.server = server;
+		this.url = url;
+		this.maxPings = maxPings;
+		this.behaviour = behaviour;
+		Thread t = new Thread() {
+			public void run() {
+				ping();
+			}
+		};
+		t.setDaemon(true);
+		t.start();
+	}
+
+	/**
+	 * Ping the server until it is started. Then set the server state to
+	 * STATE_STARTED.
+	 */
+	protected void ping() {
+		int count = 0;
+		try {
+			Thread.sleep(PING_DELAY);
+		} catch (Exception e) {
+			// ignore
+		}
+		while (!stop) {
+			try {
+				if (count == maxPings) {
+					try {
+						server.stop(false);
+					} catch (Exception e) {
+						Trace.trace(Trace.FINEST, "Ping: could not stop server");
+					}
+					stop = true;
+					break;
+				}
+				count++;
+
+				Trace.trace(Trace.FINEST, "Ping: pinging");
+				URL pingUrl = new URL(url);
+				URLConnection conn = pingUrl.openConnection();
+				((HttpURLConnection) conn).getResponseCode();
+
+				// ping worked - server is up
+				if (!stop) {
+					Trace.trace(Trace.FINEST, "Ping: success");
+					Thread.sleep(200);
+					behaviour.setServerStarted();
+				}
+				stop = true;
+			} catch (FileNotFoundException fe) {
+				try {
+					Thread.sleep(200);
+				} catch (Exception e) {
+					// ignore
+				}
+				behaviour.setServerStarted();
+				stop = true;
+			} catch (Exception e) {
+				Trace.trace(Trace.FINEST, "Ping: failed");
+				// pinging failed
+				if (!stop) {
+					try {
+						Thread.sleep(PING_INTERVAL);
+					} catch (InterruptedException e2) {
+						// ignore
+					}
+				}
+			}
+		}
+	}
+
+	/**
+	 * Tell the pinging to stop.
+	 */
+	public void stop() {
+		Trace.trace(Trace.FINEST, "Ping: stopping");
+		stop = true;
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/ProgressUtil.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/ProgressUtil.java
new file mode 100644
index 0000000..788a656
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/ProgressUtil.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+/**
+ * Progress Monitor utility.
+ */
+public class ProgressUtil {
+	/**
+	 * ProgressUtil constructor comment.
+	 */
+	private ProgressUtil() {
+		super();
+	}
+
+	/**
+	 * Return a valid progress monitor.
+	 * 
+	 * @param monitor org.eclipse.core.runtime.IProgressMonitor
+	 * @return org.eclipse.core.runtime.IProgressMonitor
+	 */
+	public static IProgressMonitor getMonitorFor(IProgressMonitor monitor) {
+		if (monitor == null)
+			return new NullProgressMonitor();
+		return monitor;
+	}
+
+	/**
+	 * Return a sub-progress monitor with the given amount on the current
+	 * progress monitor.
+	 * 
+	 * @param monitor org.eclipse.core.runtime.IProgressMonitor
+	 * @param ticks int
+	 * @return org.eclipse.core.runtime.IProgressMonitor
+	 */
+	public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks) {
+		if (monitor == null)
+			return new NullProgressMonitor();
+		if (monitor instanceof NullProgressMonitor)
+			return monitor;
+		return new SubProgressMonitor(monitor, ticks);
+	}
+
+	/**
+	 * Return a sub-progress monitor with the given amount on the current
+	 * progress monitor.
+	 * 
+	 * @param monitor org.eclipse.core.runtime.IProgressMonitor
+	 * @param ticks a number of ticks
+	 * @param style a style
+	 * @return org.eclipse.core.runtime.IProgressMonitor
+	 */
+	public static IProgressMonitor getSubMonitorFor(IProgressMonitor monitor, int ticks,
+			int style) {
+		if (monitor == null)
+			return new NullProgressMonitor();
+		if (monitor instanceof NullProgressMonitor)
+			return monitor;
+		return new SubProgressMonitor(monitor, ticks, style);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Trace.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Trace.java
new file mode 100644
index 0000000..dab0b8b
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/Trace.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Helper class to route trace output.
+ */
+public class Trace {
+	public static byte CONFIG = 0;
+	public static byte WARNING = 1;
+	public static byte SEVERE = 2;
+	public static byte FINEST = 3;
+	public static byte FINER = 4;
+	
+	private static final String[] levelNames = new String[] { "CONFIG   ", "WARNING  ",
+		"SEVERE   ", "FINER    ", "FINEST   " };
+
+	private static final String spacer = "                                   ";
+
+	private static final SimpleDateFormat sdf = new SimpleDateFormat(
+			"dd/MM/yy HH:mm.ss.SSS");
+
+	protected static int pluginLength = -1;
+
+	/**
+	 * Trace constructor comment.
+	 */
+	private Trace() {
+		super();
+	}
+
+	/**
+	 * Trace the given text.
+	 * 
+	 * @param level the trace level
+	 * @param s a message
+	 */
+	public static void trace(byte level, String s) {
+		Trace.trace(level, s, null);
+	}
+
+	/**
+	 * Trace the given message and exception.
+	 * 
+	 * @param level the trace level
+	 * @param s a message
+	 * @param t a throwable
+	 */
+	public static void trace(byte level, String s, Throwable t) {
+		if (!HttpCorePlugin.getInstance().isDebugging())
+			return;
+
+		/*
+		 * System.out.println(ApachePlugin.PLUGIN_ID + " " + s); if (t != null)
+		 * t.printStackTrace();
+		 */
+		trace(HttpCorePlugin.PLUGIN_ID, level, s, t);
+	}
+
+	/**
+	 * Trace the given message and exception.
+	 * 
+	 * @param level a trace level
+	 * @param s a message
+	 * @param t a throwable
+	 */
+	private static void trace(String pluginId, int level, String s, Throwable t) {
+		if (pluginId == null || s == null)
+			return;
+
+		if (!HttpCorePlugin.getInstance().isDebugging())
+			return;
+
+		StringBuffer sb = new StringBuffer(pluginId);
+		if (pluginId.length() > pluginLength)
+			pluginLength = pluginId.length();
+		else if (pluginId.length() < pluginLength)
+			sb.append(spacer.substring(0, pluginLength - pluginId.length()));
+		sb.append(" ");
+		sb.append(levelNames[level]);
+		sb.append(" ");
+		sb.append(sdf.format(new Date()));
+		sb.append(" ");
+		sb.append(s);
+		// Platform.getDebugOption(ServerCore.PLUGIN_ID + "/" + "resources");
+
+		System.out.println(sb.toString());
+		if (t != null)
+			t.printStackTrace();
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyPortCommand.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyPortCommand.java
new file mode 100644
index 0000000..4ffc642
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyPortCommand.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal.command;
+
+import org.eclipse.wst.server.core.ServerPort;
+import org.eclipse.wst.server.http.core.internal.HttpServer;
+import org.eclipse.wst.server.http.core.internal.Messages;
+/**
+ * Command to change the port.
+ */
+public class ModifyPortCommand extends ServerCommand {
+	protected String id;
+	protected int port;
+	protected int oldPort;
+
+	/**
+	 * ModifyPortCommand constructor.
+	 * 
+	 * @param server a server
+	 * @param id a port id
+	 * @param port new port number
+	 */
+	public ModifyPortCommand(HttpServer server, String id, int port) {
+		super(server, Messages.configurationEditorActionModifyPort);
+		this.id = id;
+		this.port = port;
+	}
+
+	/**
+	 * Execute the command.
+	 */
+	public void execute() {
+		// find old port number
+		ServerPort temp = server.getServerPorts()[0];
+		if (id.equals(temp.getId()))
+			oldPort = temp.getPort();
+		
+		// make the change
+		server.setPort(port);
+	}
+
+	/**
+	 * Undo the command.
+	 */
+	public void undo() {
+		server.setPort(oldPort);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyPublishDirectoryCommand.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyPublishDirectoryCommand.java
new file mode 100644
index 0000000..aa0d6ff
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyPublishDirectoryCommand.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal.command;
+
+import org.eclipse.wst.server.http.core.internal.HttpServer;
+
+public class ModifyPublishDirectoryCommand extends ServerCommand {
+	protected String pubDir;
+	protected String oldPubDir;
+
+	public ModifyPublishDirectoryCommand(HttpServer server, String pubDir) {
+		super(server, "set the publish directory");
+		this.pubDir = pubDir;
+	}
+
+	/**
+	 * Execute the command.
+	 */
+	public void execute() {
+		oldPubDir = server.getPublishDirectory();
+		server.setPublishDirectory(pubDir);
+	}
+
+	/**
+	 * Undo the command.
+	 */
+	public void undo() {
+		server.setPublishDirectory(oldPubDir);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyURLPrefixCommand.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyURLPrefixCommand.java
new file mode 100644
index 0000000..a8f5b43
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ModifyURLPrefixCommand.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal.command;
+
+import org.eclipse.wst.server.http.core.internal.HttpServer;
+import org.eclipse.wst.server.http.core.internal.Messages;
+
+public class ModifyURLPrefixCommand extends ServerCommand {
+	protected String prefix;
+	protected String oldPrefix;
+
+	/**
+	 * ModifyURLPrefixCommand constructor.
+	 * 
+	 * @param server a HTTP configuration
+	 * @param prefix a new prefix
+	 */
+	public ModifyURLPrefixCommand(HttpServer server, String prefix) {
+		super(server, Messages.configurationEditorActionModifyPort);
+		this.prefix = prefix;
+	}
+
+	/**
+	 * Execute the command.
+	 */
+	public void execute() {
+		// find old prefix
+		oldPrefix = server.getURLPrefix();
+
+		// make the change
+		server.setURLPrefix(prefix);
+	}
+
+	/**
+	 * Undo the command.
+	 */
+	public void undo() {
+		server.setURLPrefix(oldPrefix);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ServerCommand.java b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ServerCommand.java
new file mode 100644
index 0000000..0ad3f60
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.core/src/org/eclipse/wst/server/http/core/internal/command/ServerCommand.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.core.internal.command;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.server.http.core.internal.HttpServer;
+/**
+ * Server command.
+ */
+public abstract class ServerCommand extends AbstractOperation {
+	protected HttpServer server;
+
+	/**
+	 * ServerCommand constructor comment.
+	 * 
+	 * @param server a server
+	 * @param label a label
+	 */
+	public ServerCommand(HttpServer server, String label) {
+		super(label);
+		this.server = server;
+	}
+
+	public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+		return execute(monitor, info);
+	}
+
+	public abstract void execute();
+
+	public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+			throws ExecutionException {
+		execute();
+		return null;
+	}
+
+	public abstract void undo();
+
+	public IStatus undo(IProgressMonitor monitor, IAdaptable info)
+			throws ExecutionException {
+		undo();
+		return null;
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/.classpath b/plugins/org.eclipse.wst.server.http.ui/.classpath
new file mode 100644
index 0000000..52165ec
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.wst.server.http.ui/.cvsignore b/plugins/org.eclipse.wst.server.http.ui/.cvsignore
new file mode 100644
index 0000000..33dd7de
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/.cvsignore
@@ -0,0 +1,6 @@
+bin
+temp.folder
+build.xml
+@dot
+src.zip
+javaCompiler...args
diff --git a/plugins/org.eclipse.wst.server.http.ui/.project b/plugins/org.eclipse.wst.server.http.ui/.project
new file mode 100644
index 0000000..5a8769f
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.server.http.ui</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..c8be432
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Fri Nov 10 17:11:35 HST 2006
+eclipse.preferences.version=1
+encoding/<project>=ISO-8859-1
diff --git a/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..a92c4fc
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,74 @@
+#Thu Mar 08 13:02:41 PST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.builder.cleanOutputFolder=clean
+org.eclipse.jdt.core.builder.duplicateResourceTask=error
+org.eclipse.jdt.core.builder.invalidClasspath=abort
+org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
+org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg
+org.eclipse.jdt.core.circularClasspath=error
+org.eclipse.jdt.core.classpath.exclusionPatterns=disabled
+org.eclipse.jdt.core.classpath.multipleOutputLocations=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=error
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=error
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=error
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.4
+org.eclipse.jdt.core.incompatibleJDKLevel=warning
+org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000..2e94ed4
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,3 @@
+#Thu Mar 08 13:02:39 PST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000..08a60e5
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,14 @@
+#Sat Apr 22 18:36:14 EDT 2006
+compilers.incompatible-environment=0
+compilers.p.build=0
+compilers.p.deprecated=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=0
+compilers.p.unknown-class=0
+compilers.p.unknown-element=0
+compilers.p.unknown-resource=0
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.use-project=true
+eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.wst.server.http.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.server.http.ui/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..4283674
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.wst.server.http.ui;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.wst.server.http.ui.internal.HttpUIPlugin
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Export-Package: org.eclipse.wst.server.http.ui.internal;x-internal:=true
+Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.wst.server.core;bundle-version="[1.0.204,2.0.0)",
+ org.eclipse.wst.server.ui;bundle-version="[1.0.103,1.1.0)",
+ org.eclipse.wst.server.http.core;bundle-version="[1.0.0,2.0.0)"
+Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
diff --git a/plugins/org.eclipse.wst.server.http.ui/about.html b/plugins/org.eclipse.wst.server.http.ui/about.html
new file mode 100644
index 0000000..4ec5989
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/about.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>May 2, 2006</P>
+
+<H3>License</H3>
+
+<P>The Eclipse Foundation makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from the Eclipse Foundation, the 
+Content is being redistributed by another party ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the Redistributor’s license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
+
+</BODY>
+</HTML>
diff --git a/plugins/org.eclipse.wst.server.http.ui/build.properties b/plugins/org.eclipse.wst.server.http.ui/build.properties
new file mode 100644
index 0000000..640fbf4
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/build.properties
@@ -0,0 +1,20 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+bin.includes = META-INF/,\
+               icons/,\
+               .,\
+               plugin.xml,\
+               about.html,\
+               plugin.properties
+bin.excludes = bin/**,\
+               @dot/**,\
+               temp.folder/**
+source.. = src/
diff --git a/plugins/org.eclipse.wst.server.http.ui/icons/obj16/server.gif b/plugins/org.eclipse.wst.server.http.ui/icons/obj16/server.gif
new file mode 100644
index 0000000..b51ae39
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/icons/obj16/server.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.http.ui/icons/wizban/server_wiz.gif b/plugins/org.eclipse.wst.server.http.ui/icons/wizban/server_wiz.gif
new file mode 100644
index 0000000..30de91f
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/icons/wizban/server_wiz.gif
Binary files differ
diff --git a/plugins/org.eclipse.wst.server.http.ui/plugin.properties b/plugins/org.eclipse.wst.server.http.ui/plugin.properties
new file mode 100644
index 0000000..a4fd08c
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/plugin.properties
@@ -0,0 +1,12 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+pluginName=HTTP Server UI Support
+providerName=Eclipse.org
diff --git a/plugins/org.eclipse.wst.server.http.ui/plugin.xml b/plugins/org.eclipse.wst.server.http.ui/plugin.xml
new file mode 100644
index 0000000..4024424
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/plugin.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension point="org.eclipse.wst.server.ui.serverImages">
+      <image
+         id="org.eclipse.wst.server.http.runtime.image"
+         icon="icons/obj16/server.gif"
+         typeIds="org.eclipse.wst.server.http.runtime,org.eclipse.wst.server.http"/>
+   </extension>
+ 
+   <extension point="org.eclipse.wst.server.ui.wizardFragments">
+      <fragment
+         id="org.eclipse.wst.server.http.runtime.wizard"
+         typeIds="org.eclipse.wst.server.http.runtime"
+         class="org.eclipse.wst.server.http.ui.internal.HttpRuntimeWizardFragment"/>
+   </extension>
+
+   <extension point="org.eclipse.wst.server.ui.editorPageSections">
+   	<section
+         id="org.eclipse.wst.server.http.editor"
+         order="10"
+         insertionId="org.eclipse.wst.server.editor.overview.left"
+         typeIds="org.eclipse.wst.server.http"
+         class="org.eclipse.wst.server.http.ui.internal.HttpSection"/>
+   </extension>
+</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/ContextIds.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/ContextIds.java
new file mode 100644
index 0000000..8572679
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/ContextIds.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.ui.internal;
+/**
+ * Constant ids for context help.
+ */
+public interface ContextIds {
+	public static final String SERVER_EDITOR = HttpUIPlugin.PLUGIN_ID + ".teig0000";
+	public static final String RUNTIME_COMPOSITE = HttpUIPlugin.PLUGIN_ID + ".twnr0000";
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeComposite.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeComposite.java
new file mode 100644
index 0000000..199f2ca
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeComposite.java
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.ui.internal;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.http.core.internal.IHttpRuntimeWorkingCopy;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+/**
+ * Wizard page to set the server install directory.
+ */
+public class HttpRuntimeComposite extends Composite {
+	protected IRuntimeWorkingCopy runtimeWC;
+	protected IHttpRuntimeWorkingCopy runtime;
+	protected Text name;
+	protected Text prefix;
+	protected Text port;
+	protected Combo combo;
+	protected Button publishCheckBox;
+	protected Text publishDir;
+	protected Button browseButton;
+	protected Label locationLabel;
+	protected Label portLabel;
+	protected Label prefixLabel;
+	//private ValuesCache originalValuesCache = new ValuesCache();
+	//protected ValuesCache modifiedValuesCache;
+	protected IWizardHandle wizard;
+
+	/**
+	 * ServerCompositeFragment
+	 * 
+	 * @param parent the parent composite
+	 * @param wizard the wizard handle
+	 */
+	public HttpRuntimeComposite(Composite parent, IWizardHandle wizard) {
+		super(parent, SWT.NONE);
+		this.wizard = wizard;
+		wizard.setTitle(Messages.wizardTitle);
+		wizard.setDescription(Messages.wizardDescription);
+		wizard.setImageDescriptor(HttpUIPlugin.getImageDescriptor(HttpUIPlugin.IMG_WIZ_SERVER));
+
+		createControl();
+	}
+
+	protected void setRuntime(IRuntimeWorkingCopy newRuntime) {
+		if (newRuntime == null) {
+			runtimeWC = null;
+			runtime = null;
+		} else {
+			runtimeWC = newRuntime;
+			runtime = (IHttpRuntimeWorkingCopy) newRuntime.loadAdapter(IHttpRuntimeWorkingCopy.class, null);
+		}
+		
+		init();
+		validate();
+	}
+
+	/**
+	 * Provide a wizard page to change the Apache installation directory.
+	 */
+	protected void createControl() {
+		GridLayout layout = new GridLayout(1, true);
+		setLayout(layout);
+		setLayoutData(new GridData(GridData.FILL_BOTH));
+
+		Composite nameGroup = new Composite(this, SWT.NONE);
+		layout = new GridLayout();
+		layout.numColumns = 2;
+		nameGroup.setLayout(layout);
+		nameGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ContextIds.RUNTIME_COMPOSITE);
+
+		Label label = new Label(nameGroup, SWT.NONE);
+		label.setText(Messages.runtimeName);
+		GridData data = new GridData();
+		label.setLayoutData(data);
+
+		name = new Text(nameGroup, SWT.BORDER);
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		name.setLayoutData(data);
+		name.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				runtimeWC.setName(name.getText());
+				validate();
+			}
+		});
+
+		createServerInfoGroup(this);
+		createPublishInfoGroup(this);
+		init();
+		validate();
+
+		Dialog.applyDialogFont(this);
+
+		name.forceFocus();
+	}
+
+	protected void init() {
+		if (name == null || runtimeWC == null || runtime == null)
+			return;
+		
+		name.setText(runtimeWC.getName());
+		publishDir.setText(runtime.getPublishLocation());
+		port.setText(runtime.getPort() + "");
+		prefix.setText(runtime.getPrefixPath());
+		
+		boolean canPublish = runtime.publishToDirectory();
+		publishCheckBox.setSelection(canPublish);
+		publishDir.setEnabled(canPublish);
+		browseButton.setEnabled(canPublish);
+		locationLabel.setEnabled(canPublish);
+	}
+
+	protected void validate() {
+		if (runtime == null) {
+			wizard.setMessage("", IMessageProvider.ERROR);
+			return;
+		}
+		
+		wizard.setMessage(null, IMessageProvider.NONE);
+		
+		if (runtimeWC != null) {
+			String name2 = runtimeWC.getName();
+			if (name2 == null || name2.trim().equals("")) {
+				wizard.setMessage(Messages.wizardMissingRuntimeName, IMessageProvider.ERROR);
+			} else {
+				boolean ok = checkRuntimeName(name2);
+				if (!ok) {
+					wizard.setMessage(Messages.wizardDuplicateName, IMessageProvider.ERROR);
+				}
+			}
+		}
+	}
+
+	private void createServerInfoGroup(Composite parent) {
+		Font font = parent.getFont();
+		// Server information group
+		Group serverInfoGroup = new Group(parent, SWT.NONE);
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 2;
+		serverInfoGroup.setLayout(layout);
+		serverInfoGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		serverInfoGroup.setFont(font);
+		serverInfoGroup.setText("Server Information");
+		
+		// port label
+		portLabel = new Label(serverInfoGroup, SWT.NONE);
+		portLabel.setFont(font);
+		portLabel.setText("HTTP Port:");
+		
+		// port entry field
+		port = new Text(serverInfoGroup, SWT.BORDER);
+		GridData data = new GridData(GridData.FILL_HORIZONTAL);
+		data.widthHint = 305;
+		port.setLayoutData(data);
+		port.setFont(font);
+		port.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				if (runtime != null)
+					try {
+						runtime.setPort(Integer.parseInt(port.getText()));
+					} catch (Exception ex) {
+						// ignore
+					}
+				validate();
+			}
+		});
+
+		// prefix label
+		prefixLabel = new Label(serverInfoGroup, SWT.NONE);
+		prefixLabel.setFont(font);
+		prefixLabel.setText("URL Prefix Path:");
+
+		// prefix entry field
+		prefix = new Text(serverInfoGroup, SWT.BORDER);
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		data.widthHint = 305;
+		prefix.setLayoutData(data);
+		prefix.setFont(font);
+		prefix.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				runtime.setPrefixPath(prefix.getText());
+				validate();
+			}
+		});
+	}
+
+	private final void createPublishInfoGroup(Composite parent) {
+		Font font = parent.getFont();
+		// publish information group
+		Group publishInfoGroup = new Group(parent, SWT.NONE);
+		GridLayout layout = new GridLayout();
+		layout.numColumns = 3;
+		publishInfoGroup.setLayout(layout);
+		publishInfoGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		publishInfoGroup.setFont(font);
+		publishInfoGroup.setText("Publish Information");
+
+		publishCheckBox = new Button(publishInfoGroup, SWT.CHECK | SWT.RIGHT);
+		publishCheckBox.setText("Publish Projects to this Server");
+		publishCheckBox.setFont(font);
+
+		publishCheckBox.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent se) {
+				Button b = (Button) se.getSource();
+				boolean selected = b.getSelection();
+
+				publishDir.setEnabled(selected);
+				browseButton.setEnabled(selected);
+				locationLabel.setEnabled(selected);
+				//publishDir.setText("");
+				runtime.setPublishToDirectory(selected);
+				validate();
+			}
+		});
+
+		GridData buttonData = new GridData();
+		buttonData.horizontalSpan = 3;
+		publishCheckBox.setLayoutData(buttonData);
+
+		createPublishLocationGroup(publishInfoGroup);
+	}
+
+	private void createPublishLocationGroup(Composite publishInfoGroup) {
+		Font font = publishInfoGroup.getFont();
+		// location label
+		locationLabel = new Label(publishInfoGroup, SWT.NONE);
+		locationLabel.setFont(font);
+		locationLabel.setText("Directory:");
+
+		// project location entry field
+		publishDir = new Text(publishInfoGroup, SWT.BORDER);
+		GridData data = new GridData(GridData.FILL_HORIZONTAL);
+		data.widthHint = 305;
+		publishDir.setLayoutData(data);
+		publishDir.setFont(font);
+		publishDir.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				runtime.setPublishLocation(publishDir.getText());
+				validate();
+			}
+		});
+		
+		// browse button
+		browseButton = new Button(publishInfoGroup, SWT.PUSH);
+		browseButton.setFont(font);
+		browseButton.setText(Messages.browse);
+		browseButton.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent event) {
+				DirectoryDialog dialog = new DirectoryDialog(HttpRuntimeComposite.this.getShell());
+				dialog.setMessage(Messages.selectInstallDir);
+				dialog.setFilterPath(publishDir.getText());
+				String selectedDirectory = dialog.open();
+				if (selectedDirectory != null)
+					publishDir.setText(selectedDirectory);
+			}
+		});
+	}
+
+	private boolean checkRuntimeName(String name2) {
+		name2 = name2.trim();
+		if (name2.equals(runtimeWC.getName())) {
+			return true;
+		}
+		IRuntime[] allRuntimes = ServerCore.getRuntimes();
+		
+		if (allRuntimes != null) {
+			int size = allRuntimes.length;
+			for (int i = 0; i < size; i++) {
+				IRuntime runtime2 = allRuntimes[i];
+				if (name2.equals(runtime2.getName()))
+					return false;
+			}
+		}
+		return true;
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeWizardFragment.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeWizardFragment.java
new file mode 100644
index 0000000..498d51c
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpRuntimeWizardFragment.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.ui.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
+import org.eclipse.wst.server.core.TaskModel;
+import org.eclipse.wst.server.ui.wizard.IWizardHandle;
+import org.eclipse.wst.server.ui.wizard.WizardFragment;
+/**
+ * Wizard fragment
+ */
+public class HttpRuntimeWizardFragment extends WizardFragment {
+	protected HttpRuntimeComposite comp;
+
+	/**
+	 * ServerWizardFragment constructor
+	 */
+	public HttpRuntimeWizardFragment() {
+		// do nothing
+	}
+
+	public boolean hasComposite() {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.wst.server.ui.task.WizardFragment#createComposite()
+	 */
+	public Composite createComposite(Composite parent, IWizardHandle wizard) {
+		comp = new HttpRuntimeComposite(parent, wizard);
+		return comp;
+	}
+
+	/*
+	 * @see org.eclipse.wst.server.ui.wizard.WizardFragment#enter()
+	 */
+	public void enter() {
+		if (comp != null) {
+			IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+			comp.setRuntime(runtime);
+		}
+	}
+
+	public boolean isComplete() {
+		IRuntimeWorkingCopy runtime = (IRuntimeWorkingCopy) getTaskModel().getObject(TaskModel.TASK_RUNTIME);
+		if (runtime == null)
+			return false;
+		IStatus status = runtime.validate(null);
+		return (status == null || status.getSeverity() != IStatus.ERROR);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpSection.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpSection.java
new file mode 100644
index 0000000..db5ddf2
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpSection.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.ui.internal;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.wst.server.http.core.internal.HttpServer;
+import org.eclipse.wst.server.http.core.internal.command.ModifyPortCommand;
+import org.eclipse.wst.server.http.core.internal.command.ModifyPublishDirectoryCommand;
+import org.eclipse.wst.server.http.core.internal.command.ModifyURLPrefixCommand;
+import org.eclipse.wst.server.ui.editor.ServerEditorSection;
+
+public class HttpSection extends ServerEditorSection {
+	protected HttpServer httpServer;
+	protected boolean updating;
+	protected Text publishDirText;
+	protected Text urlPrefixText;
+	protected Spinner portSpinner;
+	protected PropertyChangeListener listener;
+
+	public HttpSection() {
+		super();
+	}
+
+	protected void addChangeListener() {
+		listener = new PropertyChangeListener() {
+			public void propertyChange(PropertyChangeEvent event) {
+				if (updating)
+					return;
+				updating = true;
+				if (HttpServer.PROPERTY_PORT.equals(event.getPropertyName())) {
+					Integer i = (Integer) event.getNewValue();
+					portSpinner.setSelection(i.intValue());
+				} else if (HttpServer.PROPERTY_PUB_DIR.equals(event.getPropertyName())) {
+					String s = (String) event.getNewValue();
+					if (s != null)
+						publishDirText.setText(s);
+				} else if (HttpServer.PROPERTY_URL_PREFIX.equals(event.getPropertyName())) {
+					String s = (String) event.getNewValue();
+					if (s != null)
+						urlPrefixText.setText(s);
+				}
+				updating = false;
+			}
+		};
+		server.addPropertyChangeListener(listener);
+	}
+
+	public void createSection(Composite parent) {
+		super.createSection(parent);
+		
+		FormToolkit toolkit = getFormToolkit(parent.getDisplay());
+		Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
+		section.setText(Messages.editorSectionTitle);
+		section.setDescription(Messages.editorSectionDescription);
+		section.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
+		
+		Composite composite = toolkit.createComposite(section);
+		GridLayout layout = new GridLayout();
+		layout.marginHeight = 8;
+		layout.marginWidth = 8;
+		layout.numColumns = 2;
+		composite.setLayout(layout);
+		composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL));
+		toolkit.paintBordersFor(composite);
+		section.setClient(composite);
+		
+		// publish directory
+		Label label = createLabel(toolkit, composite, Messages.editorPublishDir);
+		GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+		data.horizontalSpan = 2;
+		label.setLayoutData(data);
+		
+		publishDirText = toolkit.createText(composite, "");
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		data.horizontalSpan = 2;
+		publishDirText.setLayoutData(data);
+		publishDirText.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				if (updating)
+					return;
+				updating = true;
+				execute(new ModifyPublishDirectoryCommand(httpServer, publishDirText.getText()));
+				updating = false;
+			}
+		});
+		
+		// URL prefix
+		label = createLabel(toolkit, composite, Messages.editorURLPrefix);
+		data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+		data.horizontalSpan = 2;
+		label.setLayoutData(data);
+
+		urlPrefixText = toolkit.createText(composite, "");
+		data = new GridData(GridData.FILL_HORIZONTAL);
+		data.horizontalSpan = 2;
+		urlPrefixText.setLayoutData(data);
+		urlPrefixText.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				if (updating)
+					return;
+				updating = true;
+				execute(new ModifyURLPrefixCommand(httpServer, urlPrefixText.getText()));
+				updating = false;
+			}
+		});
+		
+		// port
+		createLabel(toolkit, composite, Messages.editorPort);
+		
+		portSpinner = new Spinner(composite, SWT.BORDER);
+		portSpinner.setMinimum(0);
+		data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+		portSpinner.setLayoutData(data);
+		portSpinner.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent e) {
+				if (updating)
+					return;
+				updating = true;
+				execute(new ModifyPortCommand(httpServer, "", portSpinner.getSelection()));
+				updating = false;
+			}
+		});
+		
+		initialize();
+	}
+
+	protected Label createLabel(FormToolkit toolkit, Composite parent, String text) {
+		Label label = toolkit.createLabel(parent, text);
+		label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+		return label;
+	}
+
+	public void dispose() {
+		if (server != null)
+			server.removePropertyChangeListener(listener);
+	}
+
+	/*
+	 * (non-Javadoc) Initializes the editor part with a site and input.
+	 */
+	public void init(IEditorSite site, IEditorInput input) {
+		super.init(site, input);
+		
+		httpServer = (HttpServer) server.loadAdapter(HttpServer.class, null);
+		addChangeListener();
+		initialize();
+	}
+
+	/**
+	 * Initialize the fields in this editor.
+	 */
+	protected void initialize() {
+		if (publishDirText == null)
+			return;
+		updating = true;
+		
+		String pubDir = httpServer.getPublishDirectory();
+		if (pubDir != null)
+			publishDirText.setText(pubDir);
+		publishDirText.setEnabled(!readOnly);
+		
+		String urlPrefix = httpServer.getURLPrefix();
+		if (urlPrefix != null)
+			urlPrefixText.setText(urlPrefix);
+		urlPrefixText.setEnabled(!readOnly);
+		
+		portSpinner.setSelection(httpServer.getPort());
+		portSpinner.setEnabled(!readOnly);
+		updating = false;
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpUIPlugin.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpUIPlugin.java
new file mode 100644
index 0000000..0d9a794
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/HttpUIPlugin.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.ui.internal;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class HttpUIPlugin extends AbstractUIPlugin {
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.eclipse.wst.server.http.ui";
+
+	private Map imageDescriptors = new HashMap();
+
+	// base url for icons
+	private static URL ICON_BASE_URL;
+	private static final String URL_WIZBAN = "wizban/";
+	public static final String IMG_WIZ_SERVER = "wizServer";
+
+	// The shared instance
+	private static HttpUIPlugin plugin;
+
+	/**
+	 * The constructor
+	 */
+	public HttpUIPlugin() {
+		plugin = this;
+	}
+
+	/**
+	 * Returns the singleton instance of this plugin.
+	 * 
+	 * @return HttpUIPlugin
+	 */
+	public static HttpUIPlugin getInstance() {
+		return plugin;
+	}
+
+	protected ImageRegistry createImageRegistry() {
+		ImageRegistry registry = new ImageRegistry();
+		registerImage(registry, IMG_WIZ_SERVER, URL_WIZBAN + "server_wiz.gif");
+		
+		return registry;
+	}
+
+	/**
+	 * Return the image with the given key from the image registry.
+	 * 
+	 * @param key java.lang.String
+	 * @return org.eclipse.jface.parts.IImage
+	 */
+	public static Image getImage(String key) {
+		return getInstance().getImageRegistry().get(key);
+	}
+
+	/**
+	 * Return the image with the given key from the image registry.
+	 * 
+	 * @param key java.lang.String
+	 * @return org.eclipse.jface.parts.IImage
+	 */
+	public static ImageDescriptor getImageDescriptor(String key) {
+		try {
+			getInstance().getImageRegistry();
+			return (ImageDescriptor) getInstance().imageDescriptors.get(key);
+		} catch (Exception e) {
+			return null;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Register an image with the registry.
+	 * 
+	 * @param key java.lang.String
+	 * @param partialURL java.lang.String
+	 */
+	private void registerImage(ImageRegistry registry, String key, String partialURL) {
+		if (ICON_BASE_URL == null) {
+			String pathSuffix = "icons/";
+			ICON_BASE_URL = plugin.getBundle().getEntry(pathSuffix);
+		}
+
+		try {
+			ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL,
+					partialURL));
+			registry.put(key, id);
+			imageDescriptors.put(key, id);
+		} catch (Exception e) {
+			Trace.trace(Trace.WARNING, "Error registering image", e);
+		}
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.java
new file mode 100644
index 0000000..e08c5bc
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.ui.internal;
+
+import org.eclipse.osgi.util.NLS;
+/**
+ * Translated messages.
+ */
+public class Messages extends NLS {
+	public static String browse;
+	public static String runtimeName;
+	public static String selectInstallDir;
+	public static String wizardDescription;
+	public static String wizardDuplicateName;
+	public static String wizardMissingRuntimeName;
+	public static String wizardTitle;
+	public static String editorSectionTitle;
+	public static String editorSectionDescription;
+	public static String editorPublishDir;
+	public static String editorURLPrefix;
+	public static String editorPort;
+
+	static {
+		NLS.initializeMessages(HttpUIPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
+	}
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.properties b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.properties
new file mode 100644
index 0000000..b6775b0
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Messages.properties
@@ -0,0 +1,29 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+# 
+# Contributors:
+#     IBM Corporation - initial API and implementation
+###############################################################################
+
+runtimeName=Na&me:
+browse=B&rowse...
+installDir=HTTP server document root:
+port=Server Port:
+
+selectInstallDir=Select HTTP server document root.
+
+# Apache server wizard and editor
+wizardTitle=HTTP Server
+wizardDescription=Specify the HTTP server information
+wizardDuplicateName=Duplicate Server Name
+wizardMissingRuntimeName=Missing Runtime Name
+
+editorSectionTitle=HTTP Server
+editorSectionDescription=Specify publishing directory and URL.
+editorPublishDir=Publishing Directory:
+editorURLPrefix=URL Prefix Path:
+editorPort=HTTP Port:
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java
new file mode 100644
index 0000000..d0a557c
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.http.ui/src/org/eclipse/wst/server/http/ui/internal/Trace.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.http.ui.internal;
+/**
+ * Helper class to route trace output.
+ */
+public class Trace {
+	public static byte CONFIG = 0;
+	public static byte WARNING = 1;
+	public static byte SEVERE = 2;
+	public static byte FINEST = 3;
+	public static byte FINER = 4;
+
+	/**
+	 * Trace constructor comment.
+	 */
+	private Trace() {
+		super();
+	}
+
+	/**
+	 * Trace the given text.
+	 * 
+	 * @param level the trace level
+	 * @param s a message
+	 */
+	public static void trace(byte level, String s) {
+		Trace.trace(level, s, null);
+	}
+
+	/**
+	 * Trace the given message and exception.
+	 * 
+	 * @param level the trace level
+	 * @param s a message
+	 * @param t a throwable
+	 */
+	public static void trace(byte level, String s, Throwable t) {
+		if (!HttpUIPlugin.getInstance().isDebugging())
+			return;
+
+		System.out.println(HttpUIPlugin.PLUGIN_ID + " " + s);
+		if (t != null)
+			t.printStackTrace();
+	}
+}
\ No newline at end of file