diff options
Diffstat (limited to 'plugins/org.eclipse.wst.server.preview/src/org/eclipse/wst/server/preview/internal/ServerConfig.java')
-rw-r--r-- | plugins/org.eclipse.wst.server.preview/src/org/eclipse/wst/server/preview/internal/ServerConfig.java | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/plugins/org.eclipse.wst.server.preview/src/org/eclipse/wst/server/preview/internal/ServerConfig.java b/plugins/org.eclipse.wst.server.preview/src/org/eclipse/wst/server/preview/internal/ServerConfig.java deleted file mode 100644 index ea1cc4119..000000000 --- a/plugins/org.eclipse.wst.server.preview/src/org/eclipse/wst/server/preview/internal/ServerConfig.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 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.preview.internal; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -public class ServerConfig { - private String configPath; - private Module[] modules; - private int port = 8080; - - public ServerConfig(String configPath) { - this.configPath = configPath; - init(); - } - - private void init() { - File f = new File(configPath); - if (!f.exists()) - System.err.println("Config doesn't exist at " + configPath); - else { - try { - IMemento memento = XMLMemento.loadMemento(f); - Integer prt = memento.getInteger("port"); - if (prt != null) - port = prt.intValue(); - - IMemento[] modules2 = memento.getChildren("module"); - int size = modules2.length; - List<Module> list = new ArrayList<Module>(size); - for (IMemento mod : modules2) { - String name = mod.getString("name"); - boolean isStatic = "static".equals(mod.getString("type")); - String path = mod.getString("path"); - String context = mod.getString("context"); - Module module = new Module(name, isStatic, context, path); - list.add(module); - } - - modules = new Module[list.size()]; - list.toArray(modules); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - public int getPort() { - return port; - } - - public Module[] getModules() { - return modules; - } -}
\ No newline at end of file |