简单Web服务器设计与实现课程设计(15)

2021-01-20 18:12

计算机网络课设报告,java平台实现,Java;HTTP;Web服务器

getConfig();

start();

}

public static void main(String[] args)

{

HttpServer httpserver = new HttpServer();

}

private void getConfig()

{

File fileCon=new File(Basic_Root,"config.ini");

File fileDir=new File(WEB_ROOT);

File fileWeb=new File(WEB_ROOT,"index.htm");

if(!fileCon.exists())

{

System.out.println("配置文件Config.ini损坏,重建中..."); reBuildConfig(fileCon);

}

if (!fileDir.exists())

{

System.out.println("网页存放文件夹不存在,重建中...");

fileDir.mkdir();

System.out.print("完成!请在");

System.out.println(WEB_ROOT+"中放置网页文件...");

System.out.println("Web服务器将重新初始化...");

getConfig();

}

if (!fileWeb.exists())

{

reBuildWeb(fileWeb);

}

Properties pps = new Properties();

try

{

pps.load(new FileInputStream("config.ini"));

Enumeration enumer = pps.propertyNames();

String strKey = (String) enumer.nextElement();

String strValue = pps.getProperty(strKey);

if (strValue.equals("") != true)

{

WEB_ROOT = strValue;

}

System.out.println("网页文件的存放路径为: "+WEB_ROOT);

strKey = (String) enumer.nextElement();

strValue = pps.getProperty(strKey);

if (strValue.equals("") != true)


简单Web服务器设计与实现课程设计(15).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:2013年中国十大证券公司排行榜

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: