我这段JAVA程序是什么意思,高分!!!

来源:百度知道 编辑:UC知道 时间:2024/06/21 11:28:58
package myservlet.control;

if(!isLetterOrDigital)
response.sendRedirect("upload.jsp");
String savedFileName = logname.concat(filename);
random.seek(0L);
long forthEndPosition = 0L;
for(int forth = 1; (n = random.readByte()) != -1 && forth <= 4;)
if(n == 10)
{
forthEndPosition = random.getFilePointer();
forth++;
}

File dir = new File("d:/Tomcat/webapps/wljxSystem/upordown");
dir.mkdir();
File file[] = dir.listFiles();
for(int k = 0; k < file.length; k++)
if(!file[k].getName().startsWith(logname));

File savingFile = new File(dir, savedFileName);
RandomAccessFile random2 = new RandomAccessFile(savingFile, "rw");

if(!isLetterOrDigital)
// 如果isletterordigital不为空跳转到upload.jsp
response.sendRedirect("upload.jsp");
String savedFileName = logname.concat(filename); //赋值,获取文件名
random.seek(0L); //获取文件信息,定位到ol
long forthEndPosition = 0L;
for(int forth = 1; (n = random.readByte()) != -1 && forth <= 4;)
if(n == 10)
{
forthEndPosition = random.getFilePointer();
forth++;
}
//for循环是获取10的位置(不知道10有什么用,你没有给出)
File dir = new File("d:/Tomcat/webapps/wljxSystem/upordown");
//给出文件保存路径
dir.mkdir();
File file[] = dir.listFiles();
for(int k = 0; k < file.length; k++) //为文件分配存储空间
if(!file[k].getName().startsWith(logname));
//检查上传文件是否已存在,即是否是新文件

File savingFile = new File(dir, savedFileName);
//把新文件存储,后面是都是
RandomAccessFile random2 = new RandomAccessFile(savingFile, "rw");
random.seek(random.length());
long endPosition = random.getFilePointer(