亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? importmvnforum.java

?? 解觖java技術中后臺無法上傳數給的情況
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/admin/importexport/mvnforum/ImportMvnForum.java,v 1.12 2006/04/14 17:36:29 minhnn Exp $
 * $Author: minhnn $
 * $Revision: 1.12 $
 * $Date: 2006/04/14 17:36:29 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2006 by MyVietnam.net
 *
 * All copyright notices regarding mvnForum MUST remain 
 * intact in the scripts and in the outputted HTML.
 * The "powered by" text/logo with a link back to
 * http://www.mvnForum.com and http://www.MyVietnam.net in 
 * the footer of the pages MUST remain visible when the pages
 * are viewed on the internet or intranet.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Support can be obtained from support forums at:
 * http://www.mvnForum.com/mvnforum/index
 *
 * Correspondence and Marketing Questions can be sent to:
 * info at MyVietnam net
 *
 * @author: Igor Manic   
 */
package com.mvnforum.admin.importexport.mvnforum;

import java.io.*;
import java.util.Calendar;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mvnforum.MVNForumConfig;
import com.mvnforum.MVNForumGlobal;
import com.mvnforum.admin.ImportWebHelper;
import com.mvnforum.admin.importexport.SetParentRule;
import net.myvietnam.mvncore.exception.*;
import org.apache.commons.digester.Digester;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.SAXException;

/**
 * @author Igor Manic
 * @version $Revision: 1.12 $, $Date: 2006/04/14 17:36:29 $
 * <br/>
 * <code>ImportMvnForum</code> class encapsulates processing
 * of MVN Forum's XML or ZIP backups, and imports all the data into MVN Forum.
 * For details see {@link #importXml(File, HttpServletRequest, HttpServletResponse, int, String, Calendar, String, boolean, int)}
 * and {@link #importZip(File, HttpServletRequest, HttpServletResponse, int, String, Calendar, String, boolean, int)}
 * <br/>
 * This class cannot be instantiated.
 */
public class ImportMvnForum extends ImportWebHelper {

    /** Message log. */
    private static Log log = LogFactory.getLog(ImportMvnForum.class);

    /** Cannot instantiate. */
    private ImportMvnForum() {
    }


// =================================================================
// ===================== MAIN PUBLIC METHODS =======================
// =================================================================
    /**
     * This method performs processing of MVN Forum's XML backup file <code>importFile</code>
     * and imports the data into the MVN Forum system. It clears the database
     * and files, does neccessary setup (including startup of message output),
     * and calls {@link #processXml(File, Calendar)} to do actual processing.<br/>
     *
     * @param importFile MVN Forum XML backup file to be imported.
     * @param request Current session's <code>HttpServletRequest</code> object.
     * @param response Current session's <code>HttpServletResponse</code> object.
     * @param logonMemberID MemberID of user who is logged in, and who initiated import process.
     * @param logonMemberName MemberName of user who is logged in, and who initiated import process.
     * @param importTime The moment when import process was started.
     * @param importIP From this IP address admin requested import.
     * @param clearIfError Should it clear/reset the database in case of error.
     * @param messageLevel What messages should be written to output during the process.
     *                     For details see {@link com.mvnforum.MVNForumConfig#MESSAGE_LEVEL_ALL_MESSAGES},
     *                     {@link com.mvnforum.MVNForumConfig#MESSAGE_LEVEL_IMPORTANT_MESSAGES} and
     *                     {@link com.mvnforum.MVNForumConfig#MESSAGE_LEVEL_ONLY_ERRORS}.
     *
     * @exception ImportException If there is an error during the process. See {@link net.myvietnam.mvncore.exception.ImportException}.
     */
    public static void importXml(File importFile,
           HttpServletRequest request, HttpServletResponse response,
           int logonMemberID, String logonMemberName,
           Calendar importTime, String importIP,
           boolean clearIfError, int messageLevel)
    throws ImportException {
        try {
            response.setContentType("text/html; charset=utf-8");
            setOutputHtmlWriter(response.getWriter());
            setMessageOutputLevel(messageLevel);
            startHtml(request);
            clearDatabase();
            clearFiles(request.getSession().getServletContext());
        } catch (DatabaseException e) {
            handleFatalError("Database error while clearing previous contents.",
                             e, clearIfError, request);
        } catch (IOException e) {
            handleFatalError("I/O error while clearing previous contents.",
                             e, clearIfError, request);
        }

        try {
            processXml(importFile, importTime);
            handleSuccess(request);
        } catch (ImportException e) {
            handleFatalError(e.getMessage(), e.getException(),
                             clearIfError, request);
        } catch (IOException e) {
            handleFatalError("I/O error while reading XML file.",
                             e, clearIfError, request);
        } catch (SAXException e) {
            if (e.getException()==null) {
                handleFatalError("Error while parsing uploaded XML file.",
                                 e, clearIfError, request);
            } else {
                handleFatalError("Error while parsing uploaded XML file. Detail: "+
                                 e.getException().getMessage(), e.getException(),
                                 clearIfError, request);
            }
        } finally {
            /* Don't delete this XML since this method was maybe started from the
             * command-line, which means this file is not temporary (uploaded)
             * //if ((importFile!=null) && (importFile.exists())) importFile.delete();
             * Anyway, if neccessary, this XML will be deleted in calling WebHandler
             */
        }
    }

    /**
     * This method performs processing of MVN Forum's ZIP backup file <code>importFile</code>
     * and imports the data into the MVN Forum system. It clears the database
     * and files, does neccessary setup (including startup of message output),
     * extracts the files from ZIP, and calls {@link #processXml(File, Calendar)}
     * to do actual processing of the main XML file (found in ZIP).<br/>
     *
     * @param importFile MVN Forum ZIP backup file to be imported.
     * @param request Current session's <code>HttpServletRequest</code> object.
     * @param response Current session's <code>HttpServletResponse</code> object.
     * @param logonMemberID MemberID of user who is logged in, and who initiated import process.
     * @param logonMemberName MemberName of user who is logged in, and who initiated import process.
     * @param importTime The moment when import process was started.
     * @param importIP From this IP address admin requested import.
     * @param clearIfError If <code>true</code>, the database will be cleared/reset
     *                     in case of error rises during the import. Default <code>Guest</code>
     *                     and <code>Admin</code> users will be created.
     * @param messageLevel What amount of messages (informational, important, error)
     *                     will be written to output.
     *
     * @exception ImportException If there is an error during the process. See {@link net.myvietnam.mvncore.exception.ImportException}.
     */
    public static void importZip(File importFile,
           HttpServletRequest request, HttpServletResponse response,
           int logonMemberID, String logonMemberName,
           Calendar importTime, String importIP,
           boolean clearIfError, int messageLevel)
    throws ImportException {
        File importXml=null;
        try {
            response.setContentType("text/html; charset=utf-8");
            setOutputHtmlWriter(response.getWriter());
            setMessageOutputLevel(messageLevel);
            startHtml(request);
            clearDatabase();
            clearFiles(request.getSession().getServletContext());
        } catch (DatabaseException e) {
            handleFatalError("Database error while clearing previous contents.",
                             e, clearIfError, request);
        } catch (IOException e) {
            handleFatalError("I/O error while clearing previous contents.",
                             e, clearIfError, request);
        }

       /* Now extract ZIP file into mvnForumHome, and give me back only XML file.
        * IMPORTANT: DON'T CALL clearFiles() AFTER THE EXTRACTION OF THE ZIP!
        * Otherwise, all extracted files will be deleted too
        */
       try {
           addImportantMessage("Extracting the ZIP file.");
           importXml=extractImportZip(importFile, request);
           if (importXml==null) {
               handleFatalError("Error while extracting the file: can't find IMPORT.xml in ZIP file.",
                                null/*error*/, clearIfError, request);
           }
       } catch (IOException e) {
           handleFatalError("I/O error while extracting the file.",
                            e, clearIfError, request);
       } finally {
           importFile.delete(); importFile=null;
       }

       //from this point on, use only importXml file (importFile is deleted)
       try {
           processXml(importXml, importTime);
           handleSuccess(request);
       } catch (ImportException e) {
           handleFatalError(e.getMessage(), e.getException(),
                            clearIfError, request);
       } catch (IOException e) {
           handleFatalError("I/O error while reading XML file.",
                            e, clearIfError, request);
       } catch (SAXException e) {
           if (e.getException()==null) {
               handleFatalError("Error while parsing uploaded XML file.",
                                e, clearIfError, request);
           } else {
               handleFatalError("Error while parsing uploaded XML file. Detail: "+
                                e.getException().getMessage(), e.getException(),
                                clearIfError, request);
           }
       } finally {
           //now delete temporary XML file (extracted from ZIP, and already imported to database)
           if ((importFile!=null) && (importFile.exists())) importFile.delete();
           if ((importXml!=null) && (importXml.exists())) importXml.delete();
       }
    }

    /**
     * This method should unpack the zip into mvnForumHome.
     * It should also return importXml file (which was also extracted)
     */
    private static File extractImportZip(File importZipFile, HttpServletRequest request)
    throws IOException {
        String avatarsDir = request.getSession().getServletContext().getRealPath(MVNForumGlobal.UPLOADED_AVATAR_DIR);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人毛片在线观看| 色婷婷综合久久久久中文一区二区| 国产一区在线看| 色综合天天天天做夜夜夜夜做| 欧美日本一区二区三区四区| 国产日韩欧美在线一区| 午夜精品视频在线观看| 国产成人av电影| 日韩精品中文字幕一区二区三区 | 亚洲欧美成aⅴ人在线观看| 日韩电影免费一区| 在线观看不卡一区| 国产精品国产精品国产专区不片 | 欧美乱妇20p| 亚洲视频一区在线观看| 国产米奇在线777精品观看| 777色狠狠一区二区三区| 洋洋成人永久网站入口| 成人高清伦理免费影院在线观看| 日韩免费观看2025年上映的电影| 亚洲va欧美va人人爽| 色综合天天综合狠狠| 国产精品国产三级国产aⅴ无密码| 国产在线精品不卡| 精品噜噜噜噜久久久久久久久试看| 亚洲成在人线免费| 欧美日韩亚洲综合一区二区三区| 自拍偷拍国产亚洲| 成人av午夜电影| 中文字幕一区三区| 成人爱爱电影网址| 国产精品情趣视频| 懂色av一区二区在线播放| 国产亚洲综合在线| 国产成人av电影在线观看| 精品久久久久久久久久久久包黑料 | 一色屋精品亚洲香蕉网站| 国产剧情在线观看一区二区| 精品国产123| 国产在线乱码一区二区三区| 日韩欧美在线综合网| 蜜臀av性久久久久蜜臀aⅴ| 欧美成人bangbros| 国产一区二区免费看| 国产亚洲福利社区一区| 成人污视频在线观看| 亚洲欧洲日韩av| 欧美无砖专区一中文字| 亚洲精品成人在线| 制服丝袜亚洲色图| 精品一区二区三区在线观看国产| 精品久久久久久亚洲综合网| 国产成人啪免费观看软件| 亚洲欧美激情插 | 亚洲美女视频在线观看| 91久久久免费一区二区| 三级在线观看一区二区| 精品美女一区二区| 91一区二区在线观看| 午夜精品福利视频网站| 亚洲精品在线网站| 91麻豆视频网站| 日韩高清在线观看| 久久精品视频免费| 欧美综合久久久| 紧缚捆绑精品一区二区| 亚洲色图第一区| 欧美一级日韩不卡播放免费| 粉嫩一区二区三区在线看| 天堂蜜桃91精品| 中文字幕精品一区二区三区精品| 在线一区二区三区四区五区| 久久国产精品99精品国产| 国产精品久久久久久久久久久免费看 | 26uuuu精品一区二区| 国产成人免费视频精品含羞草妖精| 成人免费在线视频观看| 91精品国产一区二区人妖| 成人免费高清视频在线观看| 亚洲电影第三页| 国产精品天干天干在线综合| 欧美系列亚洲系列| 成人av第一页| 久久成人免费日本黄色| 亚洲一区二区综合| 欧美国产精品一区二区三区| 欧美军同video69gay| caoporen国产精品视频| 久久99精品国产麻豆婷婷| 一区二区三区在线视频观看58| 国产婷婷色一区二区三区在线| 欧美性欧美巨大黑白大战| 成人精品电影在线观看| 精品一区二区三区视频| 亚洲高清三级视频| 伊人婷婷欧美激情| 国产精品毛片久久久久久久| 3d成人动漫网站| 91国内精品野花午夜精品| 成人美女在线观看| 国产麻豆成人传媒免费观看| 老司机午夜精品| 天天爽夜夜爽夜夜爽精品视频| 亚洲色图都市小说| 亚洲视频一二三| 亚洲欧洲av一区二区三区久久| 国产欧美日韩精品a在线观看| 日韩欧美成人激情| 日韩午夜av一区| 91精品国产一区二区人妖| 884aa四虎影成人精品一区| 欧美日韩五月天| 在线视频你懂得一区| 在线观看日韩电影| 欧美中文字幕久久| 91豆麻精品91久久久久久| 在线免费不卡电影| 欧美日韩一级黄| 91精品国产黑色紧身裤美女| 欧美人与z0zoxxxx视频| 91麻豆精品国产自产在线观看一区| 欧美日韩亚洲综合一区二区三区| 欧美丝袜丝nylons| 777午夜精品视频在线播放| 欧美一区二区三区精品| 精品伦理精品一区| 国产欧美一区二区精品久导航| 欧美极品少妇xxxxⅹ高跟鞋| 国产精品丝袜一区| 亚洲精品视频一区二区| 亚洲午夜免费福利视频| 日韩1区2区3区| 激情综合网av| 国产激情偷乱视频一区二区三区| 成人av综合一区| 欧美色精品在线视频| 91精品国产91综合久久蜜臀| 精品国产一区a| 国产精品网曝门| 亚洲国产综合色| 麻豆精品久久精品色综合| 国产成人av电影在线| 日本精品裸体写真集在线观看 | 日韩一区日韩二区| 香蕉av福利精品导航| 久久精品国产精品亚洲综合| 国产精品一区二区x88av| 色综合天天综合给合国产| 欧美美女一区二区| 久久午夜老司机| 亚洲一区二区欧美日韩| 久久精品国产网站| 不卡一区二区中文字幕| 在线观看av不卡| 久久久精品影视| 亚洲一区二区三区四区五区中文 | 精品国产91洋老外米糕| 久久久精品免费免费| 亚洲最色的网站| 久久精品国产久精国产| 色婷婷综合久久久久中文一区二区 | 粉嫩aⅴ一区二区三区四区| 91在线观看美女| 日韩欧美一二三区| 亚洲欧美另类久久久精品 | 亚洲高清免费视频| 国产成人av一区二区三区在线| 在线电影欧美成精品| 国产精品九色蝌蚪自拍| 精品一区二区免费看| 色成人在线视频| 国产日韩精品一区二区三区在线| 天天综合日日夜夜精品| 一本大道久久a久久精二百| 久久综合九色综合97_久久久| 亚洲成人资源网| 色综合天天性综合| 中文字幕国产一区二区| 久久福利视频一区二区| 欧美日韩精品免费观看视频| 日韩毛片视频在线看| 国产成人综合精品三级| 精品国产乱码久久久久久1区2区 | 在线中文字幕一区二区| 国产精品视频一二三区| 91在线高清观看| 国产精品久久一级| 欧美性猛片aaaaaaa做受| 日韩精品91亚洲二区在线观看| 337p亚洲精品色噜噜| 高清日韩电视剧大全免费| 欧美日韩国产a| 欧美在线视频不卡| 国产精品性做久久久久久| 亚洲女人小视频在线观看| 26uuu亚洲综合色| 国产久卡久卡久卡久卡视频精品| 欧美色综合网站| 亚洲色图清纯唯美| 成人免费毛片aaaaa**|