Project

General

Profile

Download (1.15 KB) Statistics
| Branch: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.app.common;
11

    
12
import java.util.regex.Matcher;
13
import java.util.regex.Pattern;
14

    
15
import eu.etaxonomy.cdm.common.AccountStore;
16
import eu.etaxonomy.cdm.io.common.Source;
17

    
18
/**
19
 * @author a.babadshanjan
20
 * @created 12.05.2009
21
 *
22
 */
23
public class ImportUtils {
24
	
25
	/**
26
	 * Initializes the source.
27
	 * @param dbms
28
	 * @param strServer
29
	 * @param strDB
30
	 * @param port
31
	 * @param userName
32
	 * @param pwd
33
	 * @return the source
34
	 */
35
	public static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
36
		//establish connection
37
		Source source = null;
38
		source = new Source(dbms, strServer, strDB);
39
		source.setPort(port);
40
			
41
		pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
42
		source.setUserAndPwd(userName, pwd);
43
		// write pwd to account store
44
		return source;
45
	}
46
	
47
	
48

    
49
}
(3-3/5)