// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
package test;

import java.io.IOException;

import org.alfresco.jlan.app.CifsOnlyXMLServerConfiguration;
import org.alfresco.jlan.netbios.win32.Win32NetBIOS;
import org.alfresco.jlan.server.NetworkServer;
import org.alfresco.jlan.server.config.InvalidConfigurationException;
import org.alfresco.jlan.server.config.ServerConfiguration;
import org.alfresco.jlan.smb.server.CIFSConfigSection;
import org.alfresco.jlan.smb.server.SMBServer;

public class Server {
    public static void main(String[] args) throws IOException, InvalidConfigurationException {
        ServerConfiguration cfg = new CifsOnlyXMLServerConfiguration();
        cfg.loadConfiguration("C:\\DivJava\\jlan\\arnepc3.xml");
        if (((CIFSConfigSection)cfg.getConfigSection(CIFSConfigSection.SectionName)).hasWin32NetBIOS()) {
            Win32NetBIOS.LanaEnumerate();
        }
        NetworkServer srv = new SMBServer(cfg);
        srv.startServer();
        System.in.read();
        srv.shutdownServer(false);
        System.out.println("Done");
    }
}
