⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smartfile.java

📁 上传文件的Java类
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
// Decompiled by DJ v2.9.9.61 Copyright 2000 Atanas Neshkov  Date: 2003-6-18 20:11:44
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name:   SmartFile.java

package com.jspsmart.file;

import com.jspsmart.upload.Files;
import com.jspsmart.upload.Request;
import com.jspsmart.upload.SmartUpload;
import com.jspsmart.upload.SmartUploadException;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Hashtable;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.Vector;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpUtils;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;

// Referenced classes of package com.jspsmart.file:
//            WildCard, Fso

public class SmartFile
{

    public SmartFile()
    {
        m_rootPath = new String();
        m_requestedAction = 0;
        m_strDefaultPath = new String();
        m_readOnly = false;
        m_authentication = false;
        m_denyPhysicalPath = false;
        m_overWrite = true;
        m_showHiddenFiles = false;
        m_showProperties = true;
        m_showToolbarText = true;
        m_showPathSelect = true;
        m_showFolderSize = true;
        m_fileListPercentSize = 55;
        m_defaultSortOrder = 1;
        m_defaultSortField = 1;
        m_title = new String("jspSmartFile");
        m_iconsPath = new String("");
        m_imagesPath = new String("");
        m_language = new String();
        m_country = new String();
        m_jsEventHandler = new String();
        m_strAllowedFilesList = new String();
        m_strDeniedFilesList = new String();
        m_allowedFilesList = new Hashtable();
        m_deniedFilesList = new Hashtable();
        m_unvisibleFoldersList = new String();
        m_unvisibleFilesList = new String();
        m_inputFileSize = 50;
        m_quota = -1L;
        m_fileSeparator = new String();
        m_isVirtual = true;
        m_initialize = 0;
        m_contextPath = new String();
        m_fileName = new String();
        m_fileExtension = new String();
        m_mimeType = new String();
        m_filePhysicalPath = new String();
        m_fileRelativePath = new String();
        m_fileVirtualPath = new String();
        m_folderName = new String();
        m_folderPhysicalPath = new String();
        m_folderRelativePath = new String();
        m_folderVirtualPath = new String();
        currentLocale = new Locale(Locale.getDefault().getLanguage(), Locale.getDefault().getCountry());
        labels = ResourceBundle.getBundle("com.jspsmart.file.SmartFileLabels", currentLocale);
        mimes = ResourceBundle.getBundle("com.jspsmart.file.SmartFileMIMETypes", currentLocale);
        images = ResourceBundle.getBundle("com.jspsmart.file.SmartFileImages", currentLocale);
        colors = ResourceBundle.getBundle("com.jspsmart.file.SmartFileColors", currentLocale);
        icons = ResourceBundle.getBundle("com.jspsmart.file.SmartFileIcons", currentLocale);
        m_properties = new Hashtable();
        m_contextPath = null;
        m_properties.put("NAME", new Integer(1));
        m_properties.put("SIZE", new Integer(1));
        m_properties.put("LINK", new Integer(1));
        m_properties.put("URL", new Integer(1));
        m_properties.put("TYPE", new Integer(1));
        m_properties.put("LOCATION", new Integer(1));
        m_properties.put("CONTAINS", new Integer(1));
        m_properties.put("MODIFIED", new Integer(1));
        m_properties.put("ATTRIBUTES", new Integer(1));
    }

    /**
     * @deprecated Method init is deprecated
     */

    public final void init(ServletConfig servletconfig)
        throws ServletException
    {
        m_config = servletconfig;
        m_application = servletconfig.getServletContext();
        m_initialize = 1;
    }

    public final void initialize(ServletConfig servletconfig, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
        throws IOException, ServletException
    {
        m_config = servletconfig;
        m_application = servletconfig.getServletContext();
        m_request = httpservletrequest;
        m_response = httpservletresponse;
        m_initialize = 2;
        Calendar calendar = Calendar.getInstance();
        Calendar calendar1 = Calendar.getInstance();
        calendar1.set(2003, 6, 1);
        if(calendar.after(calendar1))
        {
            ResponseWriteLn("<HTML>");
            ResponseWriteLn("<BODY bgcolor='white'>");
            ResponseWriteLn("<font face=helv,helvetica size=2 color='red'>");
            ResponseWriteLn("This is an evaluation version of jspSmartFile.<br>");
            ResponseWriteLn("If you would like to use jspSmartFile<br>");
            ResponseWriteLn("you must purchase the licensed version.<br><br>");
            ResponseWriteLn("</strong></font>");
            ResponseWriteLn("<font face=helv,helvetica color='blue' size=2>");
            ResponseWriteLn("buy jspSmartFile online at <br>");
            ResponseWriteLn("<a href='http://www.jspSmart.com'>");
            ResponseWriteLn("http://www.jspSmart.com</a>.<br>");
            ResponseWriteLn("</font>");
            ResponseWriteLn("</BODY>");
            ResponseWriteLn("</HTML>");
        }
    }

    public final void initialize(PageContext pagecontext)
        throws IOException, ServletException
    {
        m_pageContext = pagecontext;
        m_application = pagecontext.getServletContext();
        m_session = pagecontext.getSession();
        m_request = (HttpServletRequest)pagecontext.getRequest();
        m_response = (HttpServletResponse)pagecontext.getResponse();
        m_outNew = pagecontext.getOut();
        m_initialize = 3;
        Calendar calendar = Calendar.getInstance();
        Calendar calendar1 = Calendar.getInstance();
        calendar1.set(2003, 6, 1);
        if(calendar.after(calendar1))
        {
            ResponseWriteLn("<HTML>");
            ResponseWriteLn("<BODY bgcolor='white'>");
            ResponseWriteLn("<font face=helv,helvetica size=2 color='red'>");
            ResponseWriteLn("This is an evaluation version of jspSmartFile.<br>");
            ResponseWriteLn("If you would like to use jspSmartFile<br>");
            ResponseWriteLn("you must purchase the licensed version.<br><br>");
            ResponseWriteLn("</strong></font>");
            ResponseWriteLn("<font face=helv,helvetica color='blue' size=2>");
            ResponseWriteLn("buy jspSmartFile online at <br>");
            ResponseWriteLn("<a href='http://www.jspSmart.com'>");
            ResponseWriteLn("http://www.jspSmart.com</a>.<br>");
            ResponseWriteLn("</font>");
            ResponseWriteLn("</BODY>");
            ResponseWriteLn("</HTML>");
        }
    }

    public final void initialize(ServletContext servletcontext, HttpSession httpsession, HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse, JspWriter jspwriter)
        throws IOException, ServletException
    {
        m_application = servletcontext;
        m_session = httpsession;
        m_request = httpservletrequest;
        m_response = httpservletresponse;
        m_outNew = jspwriter;
        m_initialize = 4;
        Calendar calendar = Calendar.getInstance();
        Calendar calendar1 = Calendar.getInstance();
        calendar1.set(2003, 6, 1);
        if(calendar.after(calendar1))
        {
            ResponseWriteLn("<HTML>");
            ResponseWriteLn("<BODY bgcolor='white'>");
            ResponseWriteLn("<font face=helv,helvetica size=2 color='red'>");
            ResponseWriteLn("This is an evaluation version of jspSmartFile.<br>");
            ResponseWriteLn("If you would like to use jspSmartFile<br>");
            ResponseWriteLn("you must purchase the licensed version.<br><br>");
            ResponseWriteLn("</strong></font>");
            ResponseWriteLn("<font face=helv,helvetica color='blue' size=2>");
            ResponseWriteLn("buy jspSmartFile online at <br>");
            ResponseWriteLn("<a href='http://www.jspSmart.com'>");
            ResponseWriteLn("http://www.jspSmart.com</a>.<br>");
            ResponseWriteLn("</font>");
            ResponseWriteLn("</BODY>");
            ResponseWriteLn("</HTML>");
        }
    }

    /**
     * @deprecated Method service is deprecated
     */

    public void service(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
        throws ServletException, IOException
    {
        m_request = httpservletrequest;
        m_response = httpservletresponse;
        Calendar calendar = Calendar.getInstance();
        Calendar calendar1 = Calendar.getInstance();
        calendar1.set(2003, 6, 1);
        if(calendar.after(calendar1))
        {
            ResponseWriteLn("<HTML>");
            ResponseWriteLn("<BODY bgcolor='white'>");
            ResponseWriteLn("<font face=helv,helvetica size=2 color='red'>");
            ResponseWriteLn("This is an evaluation version of jspSmartFile.<br>");
            ResponseWriteLn("If you would like to use jspSmartFile<br>");
            ResponseWriteLn("you must purchase the licensed version.<br><br>");
            ResponseWriteLn("</strong></font>");
            ResponseWriteLn("<font face=helv,helvetica color='blue' size=2>");
            ResponseWriteLn("buy jspSmartFile online at <br>");
            ResponseWriteLn("<a href='http://www.jspSmart.com'>");
            ResponseWriteLn("http://www.jspSmart.com</a>.<br>");
            ResponseWriteLn("</font>");
            ResponseWriteLn("</BODY>");
            ResponseWriteLn("</HTML>");
        }
    }

    private void ResponseWriteLn(String s)
        throws IOException
    {
        if(m_initialize == 1 || m_initialize == 2)
        {
            m_outOld = m_response.getWriter();
            m_outOld.println(s);
        } else
        {
            m_outNew.println(s);
        }
    }

    private void ResponseWrite(String s)
        throws IOException
    {
        if(m_initialize == 1 || m_initialize == 2)
        {
            m_outOld = m_response.getWriter();
            m_outOld.print(s);
        } else
        {
            m_outNew.print(s);
        }
    }

    public void setLanguage(String s, String s1)
    {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -