// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: SmartUpload.java
package com.jspsmart.upload;
import java.io.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
// Referenced classes of package com.jspsmart.upload:
// Files, Request, SmartUploadException, File
public class SmartUpload
{
public SmartUpload()
{
m_totalBytes = 0;
m_currentIndex = 0;
m_startData = 0;
m_endData = 0;
m_boundary = new String();
m_totalMaxFileSize = 0L;
m_maxFileSize = 0L;
m_deniedFilesList = new Vector();
m_allowedFilesList = new Vector();
m_denyPhysicalPath = false;
m_forcePhysicalPath = false;
m_contentDisposition = new String();
m_files = new Files();
m_formRequest = new Request();
}
/**
* @deprecated Method init is deprecated
*/
public final void init(ServletConfig servletconfig)
throws ServletException
{
m_application = servletconfig.getServletContext();
}
/**
* @deprecated Method service is deprecated
*/
public void service(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws ServletException, IOException
{
m_request = httpservletrequest;
m_response = httpservletresponse;
}
public final void initialize(ServletConfig servletconfig, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws ServletException
{
m_application = servletconfig.getServletContext();
m_request = httpservletrequest;
m_response = httpservletresponse;
}
public final void initialize(PageContext pagecontext)
throws ServletException
{
m_application = pagecontext.getServletContext();
m_request = (HttpServletRequest)pagecontext.getRequest();
m_response = (HttpServletResponse)pagecontext.getResponse();
}
/**
* @deprecated Method initialize is deprecated
*/
public final void initialize(ServletContext servletcontext, HttpSession httpsession, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, JspWriter jspwriter)
throws ServletException
{
m_application = servletcontext;
m_request = httpservletrequest;
m_response = httpservletresponse;
}
public void upload()
throws ServletException, IOException, SmartUploadException
{
int i = 0;
boolean flag = false;
long l = 0L;
boolean flag1 = false;
String s = new String();
String s2 = new String();
String s4 = new String();
String s5 = new String();
String s6 = new String();
String s7 = new String();
String s8 = new String();
String s9 = new String();
String s10 = new String();
boolean flag2 = false;
m_totalBytes = m_request.getContentLength();
m_binArray = new byte[m_totalBytes];
int j;
for(; i < m_totalBytes; i += j)
try
{
m_request.getInputStream();
j = m_request.getInputStream().read(m_binArray, i, m_totalBytes - i);
}
catch(Exception exception)
{
throw new SmartUploadException("Unable to upload.");
}
for(; !flag1 && m_currentIndex < m_totalBytes; m_currentIndex++)
if(m_binArray[m_currentIndex] == 13)
flag1 = true;
else
m_boundary = m_boundary + (char)m_binArray[m_currentIndex];
if(m_currentIndex == 1)
return;
for(m_currentIndex++; m_currentIndex < m_totalBytes; m_currentIndex = m_currentIndex + 2)
{
String s1 = getDataHeader();
m_currentIndex = m_currentIndex + 2;
boolean flag3 = s1.indexOf("filename") > 0;
String s3 = getDataFieldValue(s1, "name");
if(flag3)
{
s6 = getDataFieldValue(s1, "filename");
s4 = getFileName(s6);
s5 = getFileExt(s4);
s7 = getContentType(s1);
s8 = getContentDisp(s1);
s9 = getTypeMIME(s7);
s10 = getSubTypeMIME(s7);
}
getDataSection();
if(flag3 && s4.length() > 0)
{
if(m_deniedFilesList.contains(s5))
throw new SecurityException("The extension of the file is denied to be uploaded (1015).");
if(!m_allowedFilesList.isEmpty() && !m_allowedFilesList.contains(s5))
throw new SecurityException("The extension of the file is not allowed to be uploaded (1010).");
if(m_maxFileSize > 0L && (long)((m_endData - m_startData) + 1) > m_maxFileSize)
throw new SecurityException("Size exceeded for this file : " + s4 + " (1105).");
l += (m_endData - m_startData) + 1;
if(m_totalMaxFileSize > 0L && l > m_totalMaxFileSize)
throw new SecurityException("Total File Size exceeded (1110).");
}
if(flag3)
{
com.jspsmart.upload.File file = new com.jspsmart.upload.File();
file.setParent(this);
file.setFieldName(s3);
file.setFileName(s4);
file.setFileExt(s5);
file.setFilePathName(s6);
file.setIsMissing(s6.length() == 0);
file.setContentType(s7);
file.setContentDisp(s8);
file.setTypeMIME(s9);
file.setSubTypeMIME(s10);
if(s7.indexOf("application/x-macbinary") > 0)
m_startData = m_startData + 128;
file.setSize((m_endData - m_startData) + 1);
file.setStartData(m_startData);
file.setEndData(m_endData);
m_files.addFile(file);
} else
{
String s11 = new String(m_binArray, m_startData, (m_endData - m_startData) + 1);
m_formRequest.putParameter(s3, s11);
}
if((char)m_binArray[m_currentIndex + 1] == '-')
break;
}
}
public int save(String s)
throws ServletException, IOException, SmartUploadException
{
return save(s, 0);
}
public int save(String s, int i)
throws ServletException, IOException, SmartUploadException
{
int j = 0;
if(s == null)
s = m_application.getRealPath("/");
if(s.indexOf("/") != -1)
{
if(s.charAt(s.length() - 1) != '/')
s = s + "/";
} else
if(s.charAt(s.length() - 1) != '\\')
s = s + "\\";
for(int k = 0; k < m_files.getCount(); k++)
if(!m_files.getFile(k).isMissing())
{
m_files.getFile(k).saveAs(s + m_files.getFile(k).getFileName(), i);
j++;
}
return j;
}
public int getSize()
{
return m_totalBytes;
}
public byte getBinaryData(int i)
{
byte byte0;
try
{
byte0 = m_binArray[i];
}
catch(Exception exception)
{
throw new ArrayIndexOutOfBoundsException("Index out of range (1005).");
}
没有合适的资源?快使用搜索试试~ 我知道了~
招聘网站jsp源码(带mysql数据库)
共789个文件
js:355个
gif:95个
png:78个
4星 · 超过85%的资源 需积分: 35 362 下载量 185 浏览量
2013-10-23
14:14:34
上传
评论 21
收藏 4.9MB ZIP 举报
温馨提示
小型的招聘网站资源,数据库可以连上,下载后只需要修改样式布局即可。
资源推荐
资源详情
资源评论
收起资源包目录
招聘网站jsp源码(带mysql数据库) (789个子文件)
#ietmp3 49KB
#ietmp7 49KB
ckeditor.asp 30KB
events.asp 4KB
advanced.asp 3KB
replaceall.asp 3KB
replace.asp 2KB
standalone.asp 2KB
sample_posteddata.asp 1KB
run.bat 270B
SmartUpload.class 18KB
File.class 6KB
MultipartRequestWrapper.class 5KB
NewsDao.class 4KB
NewsServlet.class 4KB
DataBaseConn.class 3KB
JobSeeker.class 2KB
DataBaseOperation.class 2KB
ApplyJob.class 2KB
CompanyPublishJob.class 2KB
Request.class 2KB
Company.class 2KB
Files.class 2KB
CommentServlet.class 2KB
QuanXianFilter.class 2KB
orderOfferServlet.class 2KB
News.class 2KB
CommentDao.class 1KB
DealString.class 1KB
CountServlet.class 1KB
Attachement.class 1KB
EncodeFilter.class 1KB
ShowErrorBox.class 1KB
ToGBK.class 1KB
BaseServlet.class 1KB
Comment.class 916B
DealTime.class 836B
SmartUploadException.class 386B
.classpath 1KB
org.eclipse.wst.jsdt.ui.superType.container 49B
editor.css 35KB
editor.css 31KB
editor.css 31KB
dialog.css 20KB
dialog.css 18KB
dialog.css 17KB
dialog.css 16KB
dialog.css 15KB
dialog.css 13KB
toolbar.css 13KB
toolbar.css 11KB
toolbar.css 10KB
richcombo.css 8KB
richcombo.css 7KB
icons.css 7KB
richcombo.css 7KB
icons.css 6KB
icons.css 6KB
menu.css 6KB
menu.css 5KB
menu.css 5KB
mainui.css 4KB
panel.css 4KB
panel.css 4KB
panel.css 4KB
mainui.css 3KB
yui.css 3KB
mainui.css 3KB
yui.css 3KB
cn.css 3KB
sample.css 2KB
output_xhtml.css 2KB
templates.css 2KB
templates.css 2KB
templates.css 2KB
reset.css 2KB
reset.css 2KB
reset.css 2KB
templates.css 2KB
templates.css 1KB
templates.css 1KB
elementspath.css 1KB
toolbar.css 1KB
elementspath.css 1KB
elementspath.css 1KB
wsc.css 1KB
toolbar.css 1KB
wsc.css 1004B
presets.css 908B
contents.css 899B
presets.css 888B
presets.css 866B
editor.css 574B
editor.css 562B
editor.css 558B
left.css 556B
default.css 390B
Thumbs.db 97KB
output_for_flash.fla 84KB
seeker_body.gif 49KB
共 789 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
lilelehappy
- 粉丝: 1
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Linux知识体系复习
- 东华深度学习课后习题全部
- 基于STM32+ESP8266+OneNET平台的环境监测报警系统设计.rar
- 基于Django+Django -Rest-Framework实现的在线考试系统
- mt7628 breed 固件
- 基于STM32F103+ESP8266+机智云的室内室外各种环境监测系统设计
- 基于STM32+MPU9250的小型四轴飞行器设计-毕设开题报告&PPT&部分回答问题.rar
- 基于STM32+NB-IOT的风机环境监控系统设计
- STM32单片机FPGA毕设电路原理论文报告一种基于单片机的节能断电保护电路设计
- 基于python+django+vue开发的外卖点餐系统
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页