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

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

?? importmvnforum.java

?? 解觖java技術(shù)中后臺(tái)無法上傳數(shù)給的情況
?? JAVA
?? 第 1 頁 / 共 3 頁
字號(hào):
/*
 * $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);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
aaa欧美大片| 欧美高清一级片在线观看| 欧美午夜精品久久久久久孕妇| 国产成人免费av在线| 国产乱人伦偷精品视频免下载| 久久精品国内一区二区三区| 久久99精品久久只有精品| 亚洲电影第三页| 欧美精品在线一区二区| 精品国产乱码久久久久久夜甘婷婷| 欧美午夜寂寞影院| 色8久久精品久久久久久蜜| 日本精品一区二区三区高清| 9人人澡人人爽人人精品| 成人app在线观看| 91在线精品一区二区三区| 91亚洲大成网污www| jiyouzz国产精品久久| av电影在线观看一区| 91蝌蚪国产九色| 欧美午夜精品久久久久久孕妇| 69久久夜色精品国产69蝌蚪网| 日韩视频一区二区三区| 国产日产欧美一区二区三区| 国产精品第13页| 亚洲色图视频网| 亚洲小少妇裸体bbw| 蜜臀99久久精品久久久久久软件| 国内精品第一页| 99国产精品国产精品久久| 欧美一区二区精品| 欧美国产欧美综合| 亚洲乱码国产乱码精品精98午夜| 天天av天天翘天天综合网| 另类小说图片综合网| 国产精品1区2区3区在线观看| 99久久精品久久久久久清纯| 欧美日本在线播放| 久久久久久久精| 国产精品久久久久久久久免费丝袜| 亚洲一区二区在线视频| 日本欧美韩国一区三区| 免费看欧美女人艹b| 视频一区二区欧美| 国产不卡视频一区| 欧美xxxx老人做受| 在线观看av不卡| 日韩欧美国产精品一区| 欧美韩日一区二区三区| 亚洲一二三区不卡| 国产成人精品免费在线| 欧美精品久久久久久久久老牛影院| 久久网站热最新地址| 一区二区三区小说| 免费三级欧美电影| 日本精品裸体写真集在线观看| 欧美va亚洲va香蕉在线| 亚洲综合激情网| 国产精品一二二区| 欧美欧美午夜aⅴ在线观看| 国产精品丝袜久久久久久app| 日韩有码一区二区三区| 91浏览器入口在线观看| 久久一区二区三区四区| 亚洲成人三级小说| 99久久国产综合精品麻豆| 久久众筹精品私拍模特| 午夜国产精品一区| 在线精品视频一区二区| 国产福利一区二区| 日韩三级免费观看| 亚洲r级在线视频| 中文字幕一区二区在线观看| 蜜臀久久99精品久久久久久9| 99久久精品一区| 久久综合色天天久久综合图片| 午夜视频一区在线观看| 日本乱人伦aⅴ精品| 欧美高清一级片在线观看| 国模无码大尺度一区二区三区| 5566中文字幕一区二区电影| 亚洲欧美一区二区三区极速播放 | 国产精品入口麻豆九色| 美日韩黄色大片| 欧美肥妇bbw| 婷婷国产v国产偷v亚洲高清| 色婷婷亚洲精品| 亚洲免费电影在线| 99视频一区二区三区| 欧美国产禁国产网站cc| 国产91精品免费| 国产亚洲一区二区三区| 国产成人在线视频网址| 自拍av一区二区三区| 99久久精品国产一区| 国产精品视频一二三区| 不卡av在线网| 亚洲国产高清不卡| 99视频在线精品| 日韩美女精品在线| 色妹子一区二区| 亚洲一区二区免费视频| 欧美色精品在线视频| 亚洲制服丝袜一区| 欧美电影在哪看比较好| 日日骚欧美日韩| 日韩女优电影在线观看| 精品一区二区三区香蕉蜜桃| 2017欧美狠狠色| 国产成人在线影院| 中文字幕色av一区二区三区| 91在线无精精品入口| 亚洲精品国产a| 欧美日韩国产精选| 卡一卡二国产精品| 国产丝袜在线精品| 99久久99久久免费精品蜜臀| 一区二区三区在线观看动漫| 欧美日韩一区二区不卡| 蜜臂av日日欢夜夜爽一区| 久久久久综合网| 91麻豆文化传媒在线观看| 一个色在线综合| 日韩欧美国产1| 成人一区二区三区视频在线观看 | 一区二区三区小说| 26uuu色噜噜精品一区二区| 日韩午夜激情免费电影| www.日韩在线| 国产成+人+日韩+欧美+亚洲| 亚瑟在线精品视频| 亚洲欧美日韩一区二区三区在线观看| 欧美成人免费网站| 7799精品视频| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 国产综合久久久久影院| 丁香天五香天堂综合| 久久一区二区三区四区| 粉嫩av一区二区三区| 亚洲一区av在线| 欧美不卡视频一区| 91网址在线看| 免费成人av资源网| 国产精品久99| 欧美经典一区二区| 97精品国产97久久久久久久久久久久 | 色综合色综合色综合| 麻豆国产精品777777在线| 亚洲天堂成人网| 欧美变态凌虐bdsm| 在线观看免费亚洲| 国产精品12区| 午夜欧美大尺度福利影院在线看| 国产亚洲成年网址在线观看| 欧美日韩国产一区二区三区地区| 国产一区啦啦啦在线观看| 亚洲精品欧美二区三区中文字幕| 日韩午夜电影av| 日本韩国欧美一区| 顶级嫩模精品视频在线看| 视频在线在亚洲| 亚洲黄一区二区三区| 久久久亚洲午夜电影| 欧美群妇大交群的观看方式| 99re在线精品| 国产乱子伦一区二区三区国色天香| 亚洲午夜私人影院| 国产精品视频在线看| 精品播放一区二区| 欧美日韩国产一级二级| 成人国产亚洲欧美成人综合网| 久久99热国产| 亚洲图片欧美综合| 中文字幕一区在线观看视频| 精品少妇一区二区三区日产乱码| 欧美日韩高清一区二区三区| 9久草视频在线视频精品| 国产一区视频在线看| 日韩中文字幕不卡| 亚洲午夜私人影院| 亚洲乱码国产乱码精品精98午夜| 欧美激情中文字幕| 久久老女人爱爱| 欧美不卡一区二区三区四区| 在线不卡免费av| 欧美日韩激情一区二区三区| 色欧美日韩亚洲| 色悠悠亚洲一区二区| www.欧美日韩国产在线| 国产成人亚洲综合a∨婷婷图片| 久久99久久99精品免视看婷婷| 亚洲国产欧美另类丝袜| 一区二区三区免费观看| 亚洲欧美日韩成人高清在线一区| 国产精品福利影院| 亚洲国产精品传媒在线观看| 国产亚洲一区二区三区| 久久美女高清视频 | 国产毛片精品视频| 久久99精品一区二区三区|