}
private boolean dumpFile(String s, OutputStream outputstream)
{
byte abyte0[] = new byte[4096];
boolean flag = true;
try
{
FileInputStream fileinputstream = new FileInputStream(s);
int i;
while((i = fileinputstream.read(abyte0)) != -1)
outputstream.write(abyte0, 0, i);
fileinputstream.close();
}
catch(Exception _ex)
{
flag = false;
}
return flag;
}
private Vector getGraphFiles(String as[])//获得图片文件
{
Vector vector = new Vector();
if(as == null)//如果as为空值,则返回vector中的值
return vector;
for(int i = 0; i < as.length; i++)//as.length为as[]数组长度
{
String s = as[i].toUpperCase();//设置图片文件文件名的每个字符为大写
if(isGraphFile(s))//如果为图片格式
vector.addElement(as[i]);//加入向量中
}
return vector;
}
private boolean isGraphFile(String stringFileName)
file://判断文件是否为图形格式
{
int i = stringFileName.indexOf(".");//
if(i <= 0 || i == stringFileName.length() - 1)
return false;
file://判断文件是否以GIF、JPG、JPEG或 PNG结尾
String stringExtendFileName1 = stringFileName.substring(i + 1);
return stringExtendFileName1.equals("GIF") || stringExtendFileName1.equals("JPG") || stringExtendFileName1.equals("JPEG") || stringExtendFileName1.equals("PNG");
}
private void errorMessage(String s, HttpServletResponse httpservletresponse)
throws IOException
{
httpservletresponse.setContentType("text/html");
PrintWriter out = httpservletresponse.getWriter();
out.println("");
out.println("");
out.println("");
out.println("");
out.println("");
out.println("
" + s + "
");
out.println("");
out.println("");
out.flush();
out.close();
}
private String getFromQuery(String strQuery, String strQuery1)
{
if(strQuery == null)
return "";
int i;
if((i = strQuery.indexOf(strQuery1)) < 0)
return "";
String strQuery2 = strQuery.substring(i + strQuery1.length());
if((i = strQuery2.indexOf("&")) < 0)
return strQuery2;
else
return strQuery2.substring(0, i);
}
public String getServletInfo()
{
return "旗帜广告系统 ,Wayne Zheng";
}
private static final String CPR = "© Wayne Zheng ";
private static final String DEFAULT_SITE = "www.yesky.com";
private static final String BANNER_SESSION = "旗帜广告系统 ,Wayne Zheng";
private static final String DIR = "dir";
private static final String LOG = "log";
private static final String BANNERINDEX = "bi";
private static final String EDITED = "edited";
private static final String VIEW_POSTFIX = "v";
private static final String CLICK_POSTFIX = "c";
private static final String CONFIG = "config";
private static final String MODE = "mode";
private static final String ID = "id";
private static final int BUFFER_SIZE = 4096;
static String separator = "/";
private static Hashtable cfgs;
private static Hashtable logs;
}