diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-02 07:34:08 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2015-07-02 07:34:08 +0200 |
commit | 409e23a07616387d675e065ceac7172997fef5b7 (patch) | |
tree | e77ab5bb92a492fc6d2e91b03aad9b1766e37684 /id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java | |
parent | 5bc01dab26425144a41dbece04b642fb963e1315 (diff) | |
download | moa-id-spss-409e23a07616387d675e065ceac7172997fef5b7.tar.gz moa-id-spss-409e23a07616387d675e065ceac7172997fef5b7.tar.bz2 moa-id-spss-409e23a07616387d675e065ceac7172997fef5b7.zip |
new files for key/value config
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java')
-rw-r--r-- | id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java new file mode 100644 index 000000000..2a8cd9c1c --- /dev/null +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/MigrationTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2014 Federal Chancellery Austria + * MOA-ID has been developed in a cooperation between BRZ, the Federal + * Chancellery Austria - ICT staff unit, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "Licence"); + * You may not use this work except in compliance with the Licence. + * You may obtain a copy of the Licence at: + * http://www.osor.eu/eupl/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the Licence is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the Licence for the specific language governing permissions and + * limitations under the Licence. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ +package at.gv.egovernment.moa.id.commons.config; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; + +import javax.xml.bind.JAXBException; + +/** + * @author tlenz + * + */ +public class MigrationTest { + + public static void main(String[] args) { + + String inputFile = "D:/Projekte/svn/moa-id/MOAID-2.0_config_test.xml"; + String outputFile = "D:/Projekte/svn/moa-id/MOAID-3.0_config.propery"; + + String moaidconfig = "D:/Projekte/svn/moa-id/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/conf/moa-id/moa-id.properties"; + try { + FileInputStream input = new FileInputStream(inputFile); + File out = new File(outputFile); + + ConfigurationUtil utils = new ConfigurationUtil(true); + utils.readFromXMLFileConvertToPropertyFile(input, out); + + FileInputStream dbInput = new FileInputStream(outputFile); + utils.readFromFileWriteToDB(dbInput, moaidconfig); + + + } catch (JAXBException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } +} |