ref #8689 move Cdm2Cdm migration classes from cdm-pesi to cdmlib-io and add Bupleurum...
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / app / common / ImportUtils.java
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 eu.etaxonomy.cdm.config.AccountStore;
13 import eu.etaxonomy.cdm.io.common.Source;
14
15 /**
16 * @author a.babadshanjan
17 * @since 12.05.2009
18 *
19 */
20 public class ImportUtils {
21
22 /**
23 * Initializes the source.
24 * @param dbms
25 * @param strServer
26 * @param strDB
27 * @param port
28 * @param userName
29 * @param pwd
30 * @return the source
31 */
32 public static Source makeSource(String dbms, String strServer, String strDB, int port, String userName, String pwd ){
33 //establish connection
34 Source source = null;
35 source = new Source(dbms, strServer, strDB);
36 source.setPort(port);
37
38 pwd = AccountStore.readOrStorePassword(dbms, strServer, userName, pwd);
39 source.setUserAndPwd(userName, pwd);
40 // write pwd to account store
41 return source;
42 }
43
44 }