/* * 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_labda_12.05.2015.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-configuration/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(); } } }