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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? importmvnforum.java

?? java servlet著名論壇源代碼
?? JAVA
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
 * $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();

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩影院精彩在线| 精品国产乱码久久久久久浪潮| 美脚の诱脚舐め脚责91 | 国产很黄免费观看久久| 一区二区三区四区av| 成人一区二区三区中文字幕| 九色综合狠狠综合久久| 国产精品美女一区二区三区| aaa欧美色吧激情视频| 国产精品1区2区3区在线观看| 麻豆视频观看网址久久| 中文字幕乱码一区二区免费| 欧美中文字幕一区| 久久精工是国产品牌吗| 欧美精品日韩一本| 欧美一二三四在线| 国产河南妇女毛片精品久久久| 欧美大黄免费观看| 精品欧美一区二区在线观看| 精品国一区二区三区| 欧美一级片在线| 91福利在线导航| 欧美日韩中文字幕精品| 中文字幕色av一区二区三区| 蜜臀av性久久久久蜜臀aⅴ四虎 | 亚洲精品视频在线观看网站| 中文字幕亚洲视频| 亚洲一区二区三区四区不卡| 午夜精品aaa| 日韩电影一区二区三区四区| 国产精品影视天天线| 成人国产精品免费观看| 激情综合色综合久久| 国产一区二区视频在线播放| 国产剧情一区二区| 精品剧情v国产在线观看在线| 亚洲精品在线一区二区| 亚洲福利电影网| 国产高清在线观看免费不卡| 色屁屁一区二区| 色综合色狠狠天天综合色| 久久精品视频免费观看| 国产精品对白交换视频| 国产精品丝袜91| 久久99国产精品久久99果冻传媒| 国产成人精品午夜视频免费| 99国产欧美久久久精品| 欧美大白屁股肥臀xxxxxx| 亚洲最大色网站| 91在线视频免费91| 日韩视频一区二区在线观看| 一区二区三区在线播| 亚洲福中文字幕伊人影院| 成人晚上爱看视频| 26uuu精品一区二区| 日韩中文字幕区一区有砖一区| av中文一区二区三区| 67194成人在线观看| 一本大道久久a久久综合 | 欧美日韩一区二区三区免费看| 久久综合色天天久久综合图片| 亚洲免费毛片网站| 麻豆高清免费国产一区| 欧美一区二区三区四区五区| 国产大陆精品国产| 国产三级久久久| 国产尤物一区二区| 亚洲激情中文1区| 欧美巨大另类极品videosbest | 国产性做久久久久久| 国产高清久久久久| 国产日韩精品一区二区浪潮av| 美女性感视频久久| 伊人色综合久久天天| 色一区在线观看| 亚洲视频免费观看| 日韩一级在线观看| 精品一区二区国语对白| 久久久国产精品午夜一区ai换脸| 美女脱光内衣内裤视频久久网站| 欧美吻胸吃奶大尺度电影| 久久国产剧场电影| 亚洲欧洲日产国码二区| 日本福利一区二区| 国产东北露脸精品视频| 亚洲国产精品麻豆| 一区二区三区.www| 国产精品私人自拍| 欧美日韩www| 欧美日韩国产小视频在线观看| 亚洲丝袜精品丝袜在线| 国产精品久久久久影院老司| 欧美一级片在线| 欧美色图在线观看| 久久国内精品视频| 亚洲一区二区三区四区不卡| 亚洲高清在线精品| 国产精品久久久久久福利一牛影视| 99精品欧美一区二区三区小说 | 亚洲裸体在线观看| 欧美电影在线免费观看| voyeur盗摄精品| 日韩女优av电影在线观看| 欧美亚洲精品一区| 国产成人鲁色资源国产91色综| 成人午夜电影久久影院| 青青草国产成人99久久| 亚洲品质自拍视频| 国产精品乱人伦| 国产欧美一区二区三区网站| 精品国产乱码久久久久久图片| 国产校园另类小说区| 日韩欧美一级特黄在线播放| 777久久久精品| 欧美成人精精品一区二区频| 久久久www免费人成精品| 亚洲另类春色校园小说| 成人黄色电影在线| 国产午夜精品一区二区三区视频| 亚洲嫩草精品久久| 婷婷中文字幕综合| 99精品热视频| 中文字幕中文乱码欧美一区二区| 日韩高清一级片| 99久久免费精品高清特色大片| 欧美一级片在线看| 国产女人18水真多18精品一级做| 久久99在线观看| 91香蕉视频黄| 欧美成人一级视频| 亚洲午夜av在线| 成人理论电影网| 国产精品九色蝌蚪自拍| 波多野结衣中文字幕一区二区三区| 在线免费观看日韩欧美| 自拍偷自拍亚洲精品播放| 精品一区二区三区欧美| 日韩美女视频在线| 亚洲一区二区三区视频在线| 国产精品亚洲视频| 成人av电影在线播放| 一区二区三区在线免费| www.欧美色图| 亚洲第一会所有码转帖| 欧美美女bb生活片| 亚洲免费av高清| 日韩欧美国产电影| 久久精品99国产国产精| 久久久久久久免费视频了| 国产精品夜夜嗨| 一区免费观看视频| 91精品国产91热久久久做人人 | 国产精品麻豆欧美日韩ww| 成人国产免费视频| 国产精品久久久久久久久搜平片| 激情深爱一区二区| 亚洲激情图片小说视频| 欧美精品日韩一区| 日韩va亚洲va欧美va久久| 久久久久免费观看| 精品三级在线观看| 91麻豆福利精品推荐| 中文字幕亚洲视频| 69av一区二区三区| 91在线国产观看| 亚洲成人777| 欧美精选一区二区| 99re66热这里只有精品3直播| 午夜亚洲福利老司机| 亚洲黄色片在线观看| 中文字幕av不卡| 欧美不卡一区二区| 在线观看亚洲a| 国产电影精品久久禁18| 日韩制服丝袜先锋影音| 一区二区三区视频在线看| 亚洲人成网站影音先锋播放| 欧美久久久久免费| 在线精品观看国产| 国内不卡的二区三区中文字幕| 香蕉乱码成人久久天堂爱免费| 欧美剧情电影在线观看完整版免费励志电影 | 91精品国产乱| 欧美视频你懂的| 色综合色狠狠综合色| 成人蜜臀av电影| 91免费在线视频观看| 一区二区在线电影| 日本系列欧美系列| 国产精品一区二区x88av| 亚洲va欧美va人人爽| 一色桃子久久精品亚洲| 亚洲国产日韩a在线播放性色| 亚洲 欧美综合在线网络| 亚洲欧美日韩国产综合在线| 一区二区视频免费在线观看| 亚洲123区在线观看| 国产主播一区二区三区| 国产精品一区二区果冻传媒| 色国产综合视频|