package futils;
import java.io.File;
public class Server {
    private static String serverPath;
    
    public static void main(String args[]) {
        startServer(args);  
    }
    /**
        figure out where the web pages
        and configuration files are.
    */
    public static void setServerPath() {
        File f = 
            Futil.getReadFile("locate webserver.xml");
        serverPath = f.getParent();
    }
    public static void checkResources() {
        File f = new File("webserver.xml");
        if (f.exists()) {
            serverPath = f.getParent();
            return;
        }
        setServerPath();
    }
    public static void startServer(String args[]) {
        checkResources();
        if (args != null) {
            com.sun.web.shell.Startup.main(args);
            return;
        }
        startServer();
    }
    public static void startServer() {
        String args[] ={serverPath};
        startServer(args);
    }
}