首页 电脑网络 电脑知识 正文

smartupload是什么 jspsmart是什么

  smartupload是什么 jspsmart是什么。jspSmartUpload是一款组件,用来对JSP进行程序开发过程中上传下载用的。而且还能支持下载中文名字的文件,非常简单方便,今天小编就分享

  smartupload是什么 jspsmart是什么。jspSmartUpload是一款组件,用来对JSP进行程序开发过程中上传下载用的。而且还能支持下载中文名字的文件,非常简单方便,今天小编就分享下jspSmartUpload的组件源码给大家,希望大家喜欢。


  JspSmart之upload组件源码主要包括了5个java文件


  File.java


  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 ByteArrayInputStream(m_parent.m_binArray, k, j), j);


  }


  catch(SQLException sqlexception)


  {


  byte abyte0[] = new byte[m_size];


  System.arraycopy(m_parent.m_binArray, m_startData, abyte0, 0, m_size);


  resultset.updateBytes(s, abyte0);


  }


  catch(Exception exception)


  {


  throw new SmartUploadException("Unable to save file in the DataBase (1130)。");


  }


  }


  public boolean isMissing()


  {


  return m_isMissing;


  }


  public String getFieldName()


  {


  return m_fieldname;


  }


  public String getFileName()


  {


  return m_filename;


  }


  public String getFilePathName()


  {


  return m_filePathName;


  }


  public String getFileExt()


  {


  return m_fileExt;


  }


  public String getContentType()


  {


  return m_contentType;


  }


  public String getContentDisp()


  {


  return m_contentDisp;


  }


  public String getContentString()


  {


  String s = new String(m_parent.m_binArray, m_startData, m_size);


  return s;


  }


  public String getTypeMIME()


  throws IOException


  {


  return m_typeMime;


  }


  public String getSubTypeMIME()


  {


  return m_subTypeMime;


  }


  public int getSize()


  {


  return m_size;


  }


  protected int getStartData()


  {


  return m_startData;


  }


  protected int getEndData()


  {


  return m_endData;


  }


  protected void setParent(SmartUpload smartupload)


  {


  m_parent = smartupload;


  }


  protected void setStartData(int i)


  {


  m_startData = i;


  }


  protected void setEndData(int i)


  {


  m_endData = i;


  }


  protected void setSize(int i)


  {


  m_size = i;


  }


  protected void setIsMissing(boolean flag)


  {


  m_isMissing = flag;


  }


  protected void setFieldName(String s)


  {


  m_fieldname = s;


  }


  protected void setFileName(String s)


  {


  m_filename = s;


  }


  protected void setFilePathName(String s)


  {


  m_filePathName = s;


  }


  protected void setFileExt(String s)


  {


  m_fileExt = s;


  }


  protected void setContentType(String s)


  {


  m_contentType = s;


  }


  protected void setContentDisp(String s)


  {


 

  以上就是smartupload和jspsmart的相关内容,希望大家喜欢。


(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)

本文转载自互联网,如有侵权,联系删除

本文地址:https://www.peigen.net/post/4855.html

相关推荐

板栗怎么私信主播?

板栗直播可以看直播,想必有一些用户已经知道,如果遇见自己喜欢的主播,我们该怎么私信主播呢?为此,小编特意查询资料,把板栗如何私信主播的方法分享给大家。 1)打开板栗,点击打开要私信的直播,接着点击左上...

电脑知识 2024-11-30 0 182

e兼职APP怎么进行身份认证?

e兼职app下载最靠谱的大学生兼职,帮助大学生提升技能,借用靠谱企业的力量培育大学生的社会经验与专业技能,最快5秒内找到心仪的兼职,大众点评最好的兼职软件。不过这么好用的软件,在使用前需要进行身份验证...

电脑知识 2024-11-30 0 185

口碑农场邀请码怎么获取

口碑农场是口碑app中新增加的一个玩法。口碑农场邀请码怎么获取?想要获得口碑农场的邀请码,具体该怎么操作?下面就是口碑农场邀请码获取教程,一起来看一下。...

电脑知识 2024-11-30 0 164

伙星app怎么更换主页封面?

伙星是一款关于相机相关的应用,能够让用户来制作各种好玩的、搞笑的照片,并且还有着许许多多的特效,能够让你看到很多很好玩的内容,除了这些,用户可以在里面进行拍照和漂流瓶交友等,那么在伙星app中要怎么更...

电脑知识 2024-11-30 0 157

会声会影怎么添加背景音乐?

会声会影2018是一款强大的照片|图片|视频制作、剪辑软件,具有多种的视频编辑功能和制作动画效果。但是如果想要让自己制作的视频有意思,背景音乐一定少不了,下面,小编就为大家介绍下会声会影添加背景音乐方...

电脑知识 2024-11-30 0 183

如何制作高质量的PPT?

如何制作高质量的PPT?不管是对于一个学生、老师还是上班族Word、PPT、表格这三个办公软件都是必修的技能了。我们如何将这些做得优秀?如何脱衣而出?所以呀今天我们就先来讨论一下如何制作PPT。如果...

电脑知识 2024-11-30 0 163

感谢您的支持