{
sitename1 = getFirstSite(hashtable);//站点名为哈希表中的第一个站点名
}
else
file://否则
{
Hashtable hashtable1 = (Hashtable)httpsession.getValue("旗帜广告系统 ,Wayne Zheng");
if(hashtable1 == null){
file://如果哈希表hashtable1为空值,则
sitename1 = getFirstSite(hashtable);// 站点名为哈希表(hashtable)中的第一个站点名
else
sitename1 = (String)hashtable1.get(s);
}
if(sitename1 == null)
file://如果站点名为空值则站点名为默认值http://www.yesky.com
sitename1 = "http://www.yesky.com";
String s2;
if(hashtable.get("log") != null && (s2 = getFileByUrl(hashtable, s1)) != null){
writeLog(hashtable, s2, sitename1, "c", httpservletrequest);
httpservletresponse.sendRedirect(sitename1);
}
private void showBanner(Hashtable hashtable, String s, HttpSession httpsession, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws IOException
{
String s1 = (String)hashtable.get("dir");
File file = new File(s1);
Vector vector;
if(file == null)
{
vector = new Vector();
}
else
{
String as[] = file.list();
vector = getGraphFiles(as);
}
if(vector.size() == 0)
{
httpservletresponse.setContentType("text/html");
PrintWriter out = httpservletresponse.getWriter();
out.println("目录是空的!");
out.flush();
out.close();
return;
}
int i;
if(httpsession != null)
synchronized(hashtable.get("dir"))
{
Integer integer;
int j;
if((integer = (Integer)httpsession.getValue("bi")) == null){
j = 0;
else
j = integer.intValue();
if(j >= vector.size()) {
j = 0;
i = j;
if(++j >= 3){
j = 0;
httpsession.putValue("bi", new Integer(j));
}
else
i = 0;
String s2 = (String)vector.elementAt(i);
String s3;
if(httpsession != null && (s3 = getUrl(hashtable, s2)) != null)
{
Hashtable hashtable1;
if((hashtable1 = (Hashtable)httpsession.getValue("旗帜广告系统 ,Wayne Zheng")) == null){
hashtable1 = new Hashtable();
hashtable1.put(s, s3);
httpsession.putValue("旗帜广告系统 ,Wayne Zheng", hashtable1);
}
if(hashtable.get("log") != null) {
writeLog(hashtable, s2, "v", httpservletrequest);
outputBanner(s2, hashtable, httpservletresponse);
vector = null;
}
private void writeLog(Hashtable logHashtable, String logString, String logString1, String logString2, HttpServletRequest httpservletrequest)//写日志的函数
{
String logString3 = (String)hashtable.get("log");
String logString4 = getLogString(logString, httpservletrequest) + " "" + logString1 + """;
GregorianCalendar gregoriancalendar = new GregorianCalendar();
file://获取当前的时间
gregoriancalendar.setTime(new Date());
String logString5 = logString3 + stringDate(gregoriancalendar) + logString2 + ".txt";//以时间戳和“c”或“v”为文件名来写日志文件
saveLog(hashtable, logString5, logString4);
}
private void writeLog(Hashtable logHashtable, String logString, String logString1, HttpServletRequest httpservletrequest) file://写日志文件
{
String logString2 = (String)logHashtable.get("log");
String logString3 = getLogString(logString, httpservletrequest);
GregorianCalendar gregoriancalendar = new GregorianCalendar();
gregoriancalendar.setTime(new Date());