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

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

?? importmvnforum.java

?? java servlet著名論壇源代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * $Header: /cvsroot/mvnforum/mvnforum/src/com/mvnforum/admin/importexport/mvnforum/ImportMvnForum.java,v 1.5 2004/06/27 01:20:39 skoehler Exp $
 * $Author: skoehler $
 * $Revision: 1.5 $
 * $Date: 2004/06/27 01:20:39 $
 *
 * ====================================================================
 *
 * Copyright (C) 2002-2004 by MyVietnam.net
 *
 * 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.
 *
 * 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 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@MyVietnam.net
 *
 * @author: Igor Manic   imanic@users.sourceforge.net
 */
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 org.apache.commons.digester.Digester;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.xml.sax.SAXException;
import com.mvnforum.MVNForumConfig;
import com.mvnforum.MVNForumGlobal;
import com.mvnforum.admin.ImportWebHelper;
import com.mvnforum.admin.importexport.SetParentRule;
import net.myvietnam.mvncore.exception.*;

/**
 * @author <a href="mailto:imanic@users.sourceforge.net">Igor Manic</a>
 * @version $Revision: 1.5 $, $Date: 2004/06/27 01:20:39 $
 * <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);
        String attachsDir = MVNForumConfig.getAttachmentDir();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲婷婷综合色高清在线| 亚洲人xxxx| 中文字幕+乱码+中文字幕一区| 久久精品人人做| 中文字幕亚洲电影| 亚洲日本一区二区| 亚洲成av人综合在线观看| 久久激情五月激情| 99久久免费精品| 欧美一级高清大全免费观看| 久久综合中文字幕| 亚洲一区二区三区中文字幕在线 | 亚洲一线二线三线视频| 六月丁香婷婷色狠狠久久| 粉嫩在线一区二区三区视频| 在线视频一区二区三区| 欧美成人精品福利| 一区二区三区在线免费视频| 卡一卡二国产精品| 色婷婷激情综合| 精品国产凹凸成av人导航| 亚洲美女视频在线| 国产一区二区三区综合| 欧美天堂一区二区三区| 久久久国产精华| 肉色丝袜一区二区| 91一区二区三区在线播放| 久久一二三国产| 亚洲国产一区二区a毛片| 国产成人夜色高潮福利影视| 欧美一区二区在线视频| 一区二区三区在线观看网站| 国产一区二区精品久久99| 欧美理论电影在线| 亚洲少妇中出一区| 国产激情视频一区二区在线观看| 6080国产精品一区二区| 国产欧美日韩不卡| 美女视频黄 久久| 欧美日韩五月天| 亚洲精品国产精品乱码不99| 国产.欧美.日韩| 国产精品另类一区| 久久av老司机精品网站导航| 欧美人狂配大交3d怪物一区| 一区二区三区高清不卡| 美腿丝袜在线亚洲一区| 欧美日韩精品一区二区三区| 亚洲精品成人天堂一二三| 99久久亚洲一区二区三区青草| 久久亚区不卡日本| 亚洲国产乱码最新视频 | 成人开心网精品视频| 久久综合久久99| 久久国产福利国产秒拍| 欧美一区二区三区白人| 五月激情六月综合| 91精品一区二区三区在线观看| 亚洲成人精品影院| 欧美人牲a欧美精品| 亚洲国产aⅴ天堂久久| 成人激情文学综合网| 中文字幕第一区第二区| 风间由美性色一区二区三区| 欧美国产国产综合| 岛国一区二区三区| 香蕉成人伊视频在线观看| 欧美吻胸吃奶大尺度电影| 亚洲天堂av老司机| 欧美三级日本三级少妇99| 天堂一区二区在线| 精品少妇一区二区三区日产乱码| 奇米一区二区三区| 欧美成人激情免费网| 国产一区二区三区在线观看精品| 国产日产亚洲精品系列| 91视频国产资源| 亚洲国产精品久久不卡毛片| 日韩三级电影网址| 成人网在线播放| 亚洲一卡二卡三卡四卡| 日韩欧美中文字幕一区| 国产69精品久久久久毛片| 亚洲视频资源在线| 欧美福利一区二区| 国产精品一二三四| 亚洲国产婷婷综合在线精品| 精品国产一二三| 色综合av在线| 狠狠久久亚洲欧美| 亚洲欧美视频在线观看视频| 欧美一区二区二区| 成+人+亚洲+综合天堂| 亚洲mv在线观看| 欧美sm极限捆绑bd| 欧美写真视频网站| 91同城在线观看| 国产成人8x视频一区二区| 国内精品在线播放| 日韩国产精品久久久久久亚洲| 亚洲欧美另类综合偷拍| 国产精品成人在线观看| 久久久亚洲精品一区二区三区| 91精品国产综合久久久久久久 | 日韩av一区二区三区四区| 亚洲精品高清在线| 国产精品久久福利| 欧美激情综合五月色丁香小说| 精品日韩欧美一区二区| 日韩欧美一区二区免费| 在线不卡中文字幕播放| 欧美色综合网站| 欧美最新大片在线看| 欧美在线观看一二区| 91高清在线观看| 欧美日韩一区 二区 三区 久久精品| 97精品视频在线观看自产线路二| 成人国产精品免费观看动漫| 波多野结衣91| 91视频com| 欧美日韩亚洲丝袜制服| 欧美日韩国产免费| 51精品久久久久久久蜜臀| 欧美日韩精品一区二区三区 | 色噜噜偷拍精品综合在线| 91丨porny丨国产| 色久综合一二码| 欧美系列在线观看| 欧美一区二区三区不卡| 日韩欧美的一区二区| 久久久一区二区三区| 国产精品丝袜91| 亚洲伦在线观看| 亚洲成人激情综合网| 日本人妖一区二区| 国产精品影视在线观看| 不卡的av中国片| 色婷婷一区二区三区四区| 欧美男生操女生| 久久精品一区二区三区不卡牛牛| 日本一区二区三区在线不卡| 亚洲天堂成人网| 天天色图综合网| 精品一区二区三区日韩| 成人影视亚洲图片在线| 欧美亚洲综合网| 精品va天堂亚洲国产| 国产精品久久免费看| 亚洲成人午夜电影| 国产尤物一区二区| 91丝袜国产在线播放| 欧美精品在线一区二区三区| 精品国产第一区二区三区观看体验| 中文字幕av一区二区三区高 | 欧美日韩精品一区二区三区四区| 精品久久久久香蕉网| 亚洲精品高清在线| 国内精品视频一区二区三区八戒| 99视频精品免费视频| 777色狠狠一区二区三区| 国产婷婷精品av在线| 丝袜脚交一区二区| 成人免费视频视频在线观看免费| 欧美军同video69gay| 国产精品美女久久久久久久 | 亚洲蜜臀av乱码久久精品蜜桃| 日本va欧美va欧美va精品| 91年精品国产| 日韩精品一区二区三区四区| 亚洲欧美经典视频| 国内偷窥港台综合视频在线播放| 精品视频免费在线| 国产精品久久久久久久午夜片| 日韩国产精品91| 91蝌蚪porny| 国产精品无码永久免费888| 麻豆成人久久精品二区三区小说| 成人99免费视频| 国产亚洲欧美一区在线观看| 免费美女久久99| 6080国产精品一区二区| 亚洲精品ww久久久久久p站| 高清成人在线观看| 精品国产一区二区三区忘忧草 | 国产成人精品免费视频网站| 91精品综合久久久久久| 亚洲男人的天堂网| 国产精品99久久久久久久女警| 91精品国产黑色紧身裤美女| 亚洲一区二区在线观看视频| 99精品桃花视频在线观看| 日韩无一区二区| 日韩福利电影在线| 5566中文字幕一区二区电影| 香蕉加勒比综合久久| 欧美三区免费完整视频在线观看| 一区二区在线观看免费 | 一区二区三区欧美亚洲| fc2成人免费人成在线观看播放 | 粉嫩嫩av羞羞动漫久久久|