资源简介
采用jsp+javabean开发的班级同学录,后台数据库用mysql,实现了前台和后台,适合初学者参考
代码片段和文件信息
package com.jspsmart.upload;
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.ServletException;
// Referenced classes of package com.jspsmart.upload:
// SmartUploadException SmartUpload
public class File {
private SmartUpload m_parent;
private int m_startData;
private int m_endData;
private int m_size;
private String m_fieldname;
private String m_filename;
private String m_fileExt;
private String m_filePathName;
private String m_contentType;
private String m_contentDisp;
private String m_typeMime;
private String m_subTypeMime;
private String m_contentString;
private boolean m_isMissing;
public static final int SAVEAS_AUTO = 0;
public static final int SAVEAS_VIRTUAL = 1;
public static final int SAVEAS_PHYSICAL = 2;
File() {
m_startData = 0;
m_endData = 0;
m_size = 0;
m_fieldname = new String();
m_filename = new String();
m_fileExt = new String();
m_filePathName = new String();
m_contentType = new String();
m_contentDisp = new String();
m_typeMime = new String();
m_subTypeMime = new String();
m_contentString = new String();
m_isMissing = true;
}
public void saveAs(String s) throws IOException SmartUploadException {
saveAs(s 0);
}
public void saveAs(String s int i) throws IOException
SmartUploadException {
String s1 = new String();
s1 = m_parent.getPhysicalPath(s i);
if (s1 == null)
throw new IllegalArgumentException(
“There is no specified destination file (1140).“);
try {
java.io.File file = new java.io.File(s1);
FileOutputStream fileoutputstream = new FileOutputStream(file);
fileoutputstream.write(m_parent.m_binArray m_startData m_size);
fileoutputstream.close();
} catch (IOException ioexception) {
throw new SmartUploadException(“File can‘t be saved (1120).“);
}
}
public void fileToField(ResultSet resultset String s)
throws ServletException IOException SmartUploadException
SQLException {
long l = 0L;
int i = 0x10000;
int j = 0;
int k = m_startData;
if (resultset == null)
throw new IllegalArgumentException(
“The RecordSet cannot be null (1145).“);
if (s == null)
throw new IllegalArgumentException(
“The columnName cannot be null (1150).“);
if (s.length() == 0)
throw new IllegalArgumentException(
“The columnName cannot be empty (1155).“);
l = BigInteger.valueOf(m_size).divide(BigInteger.valueOf(i))
.longValue();
j = BigInteger.valueOf(m_size).mod(BigInteger.valueOf(i)).intValue();
try {
for (int i1 = 1; (long) i1 < l; i1++) {
resultset.updateBinaryStream(s new ByteArrayInputStream(
m_parent.m_binArray k i) i);
k = k != 0 ? k : 1;
k = i1 * i + m_startData;
}
if (j > 0)
resultset.updateBinaryStream(s new
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 456 2012-04-26 23:35 班级同学录(4.0版)\class\.classpath
文件 289 2012-06-13 16:03 班级同学录(4.0版)\class\.myme
文件 1411 2012-05-19 14:54 班级同学录(4.0版)\class\.project
文件 500 2012-04-26 23:24 班级同学录(4.0版)\class\.settings\.jsdtscope
文件 1040 2012-04-30 10:12 班级同学录(4.0版)\class\.settings\com.genuitec.eclipse.j2eedt.core.prefs
文件 678 2012-06-06 23:18 班级同学录(4.0版)\class\.settings\org.eclipse.core.resources.prefs
文件 330 2012-04-26 23:24 班级同学录(4.0版)\class\.settings\org.eclipse.jdt.core.prefs
文件 49 2012-04-26 23:24 班级同学录(4.0版)\class\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2012-04-26 23:24 班级同学录(4.0版)\class\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 1798 2012-06-13 16:05 班级同学录(4.0版)\class\sql\mysql.sql
文件 778 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\all-wcprops
文件 814 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\entries
文件 2 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\format
文件 5113 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\text-ba
文件 1188 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\text-ba
文件 1459 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\text-ba
文件 17027 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\text-ba
文件 141 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\.svn\text-ba
文件 5440 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\File.java
文件 1188 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\Files.java
文件 1459 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\Request.java
文件 17027 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\SmartUpload.java
文件 141 2012-05-03 20:47 班级同学录(4.0版)\class\src\com\jspsmart\upload\SmartUploadException.java
文件 1712 2012-05-19 14:58 班级同学录(4.0版)\class\src\com\servlet\uploadPicture.java
文件 1719 2012-05-19 14:58 班级同学录(4.0版)\class\src\com\servlet\UpLoadUserHeadImage.java
文件 1673 2012-05-24 17:48 班级同学录(4.0版)\class\src\com\servlet\ZoomImage.java
文件 2467 2012-05-03 21:00 班级同学录(4.0版)\class\src\com\teetaa\util\ImageHepler.java
文件 586 2012-06-04 21:39 班级同学录(4.0版)\class\src\com\tongxuelu\Dao\count.java
文件 597 2012-05-10 09:57 班级同学录(4.0版)\class\src\com\tongxuelu\model\album_info.java
文件 1381 2012-05-16 21:11 班级同学录(4.0版)\class\src\com\tongxuelu\model\article.java
............此处省略1538个文件信息
评论
共有 条评论