001: /*
002: * $Header: /cvsroot/mvnforum/mvnforum/contrib/phpbb2mvnforum/src/org/mvnforum/util/Phpbb2MvnforumConfig.java,v 1.9 2007/01/15 10:27:31 dungbtm Exp $
003: * $Author: dungbtm $
004: * $Revision: 1.9 $
005: * $Date: 2007/01/15 10:27:31 $
006: *
007: * ====================================================================
008: *
009: * Copyright (C) 2002-2007 by MyVietnam.net
010: *
011: * All copyright notices regarding mvnForum MUST remain
012: * intact in the scripts and in the outputted HTML.
013: * The "powered by" text/logo with a link back to
014: * http://www.mvnForum.com and http://www.MyVietnam.net in
015: * the footer of the pages MUST remain visible when the pages
016: * are viewed on the internet or intranet.
017: *
018: * This program is free software; you can redistribute it and/or modify
019: * it under the terms of the GNU General Public License as published by
020: * the Free Software Foundation; either version 2 of the License, or
021: * any later version.
022: *
023: * This program is distributed in the hope that it will be useful,
024: * but WITHOUT ANY WARRANTY; without even the implied warranty of
025: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
026: * GNU General Public License for more details.
027: *
028: * You should have received a copy of the GNU General Public License
029: * along with this program; if not, write to the Free Software
030: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
031: *
032: * Support can be obtained from support forums at:
033: * http://www.mvnForum.com/mvnforum/index
034: *
035: * Correspondence and Marketing Questions can be sent to:
036: * info at MyVietnam net
037: *
038: * @author: Anh, Dong Thi Lan
039: */
040: package org.mvnforum.util;
041:
042: import java.io.*;
043: import java.util.Properties;
044:
045: public class Phpbb2MvnforumConfig {
046:
047: public static String PHP_HOST = "localhost";
048:
049: public static String PHP_DB = "peerflix_phpbb";
050:
051: public static String PHP_USER = "root";
052:
053: public static String PHP_PASS = "";
054:
055: public static String MVN_HOST = "localhost";
056:
057: public static String MVN_DB = "mvnforum";
058:
059: public static String MVN_USER = "root";
060:
061: public static String MVN_PASS = "";
062:
063: public static String FILE_NAME = "la_output.txt";
064:
065: public static int GENDER = 0;
066:
067: public static String EXPORT_XML = "phpbb-export.xml";
068:
069: public static String DATABASE_CONFIG = "phpbb";
070:
071: static {
072: Properties prop = new Properties();
073: try {
074: prop.load(new FileInputStream("db.properties"));
075: } catch (FileNotFoundException e) {
076: e.printStackTrace();
077: } catch (IOException e) {
078: e.printStackTrace();
079: }
080:
081: PHP_HOST = prop.getProperty("phphost");
082: PHP_DB = prop.getProperty("phpdb");
083: PHP_USER = prop.getProperty("phpuser");
084: PHP_PASS = prop.getProperty("phppass");
085:
086: MVN_HOST = prop.getProperty("mvnhost");
087: MVN_DB = prop.getProperty("mvndb");
088: MVN_USER = prop.getProperty("mvnuser");
089: MVN_PASS = prop.getProperty("mvnpass");
090:
091: DATABASE_CONFIG = "phpbb";
092:
093: try {
094: GENDER = Integer.parseInt(prop.getProperty("gender"));
095: if (GENDER != 0 && GENDER != 1) {
096: System.out.println("Error: Does not support GENDER = "
097: + GENDER);
098: System.out
099: .println("Warning: Use default value for GENDER: 0");
100: GENDER = 0;
101: }
102: } catch (NumberFormatException ex) {
103: ex.printStackTrace();
104: GENDER = 0;
105: }
106:
107: FILE_NAME = prop.getProperty("f");
108:
109: EXPORT_XML = prop.getProperty("exportXMLFile");
110: if (EXPORT_XML.equals("")) {
111: EXPORT_XML = "exportXML.xml";
112: }
113:
114: }
115:
116: }
|