最后完善的JAVA WEB服务器源代码(8) - 我的代码 - szxyz

(这条文章已经被阅读了 27 次) 时间:2001-04-12 08:54:22 来源:szxyz (zjxyz) 原创-IT

dealLocalFile.java
————————————————
package container.staticsou;
import java.io.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.*;
import java.util.Locale;
import java.util.Date;
import http.*;

public class dealLocalFile{

File localfile=null;
String RequestSouc;
byte[] GetContent;
boolean ListDirectory=true;

public dealLocalFile(String RequestSouc){
boolean defaultname=false;
this.RequestSouc=RequestSouc;
if ( RequestSouc.endsWith(“/”) ){
String fn[]=jwsconf.HttpConfM(“DirectoryIndex”);
for (int i=0;iName Last modified Size Description "; DirectoryHtml+="


Parent Directory "; for(int i=0;i" + filenames[i] + " " + DataString + " " + checkf.length() + " "; } DirectoryHtml+="

“;
GetContent = DirectoryHtml.getBytes();

}

public int FileExists(){

if (localfile.exists() && localfile.isDirectory() && ListDirectory==true) {
return 1;}

if (localfile.exists() && !localfile.isDirectory()){
return 2;
}else{return 0;}
}//end FileExists()

}

作者:XYZ※版权所有,

转载请注明来源
【CGI编程设计室】
http://zjxyz.yeah.net