<commit_before>package org.apache.airavata.migrator.registry;

import org.apache.airavata.common.registry.api.exception.RegistryException;
import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
import org.apache.xmlbeans.XmlException;
import org.ogce.schemas.gfac.beans.ApplicationBean;
import org.ogce.schemas.gfac.beans.HostBean;
import org.ogce.schemas.gfac.beans.ServiceBean;
import org.ogce.xregistry.client.XRegistryClient;
import org.ogce.xregistry.client.XRegistryClientUtil;
import org.ogce.xregistry.utils.XRegistryClientException;
import xregistry.generated.FindAppDescResponseDocument;
import xregistry.generated.HostDescData;
import xregistry.generated.ServiceDescData;

import javax.jcr.RepositoryException;
import javax.xml.namespace.QName;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;

public class XRegistryMigrate {
//    private static String propertyfile = "xregistry.properties";
//    private static String propertyfile = "xregistry-dropbox.properties";
    private static String propertyfile = "xregistry-local.properties";
    private static AiravataJCRRegistry jcrRegistry = null;
    private static String jcrRegsitryURL = "http://localhost:8081/";
    private static String jcrUsername = "admin";
    private static String jcrPassword = "<PASSWORD>";

    public static void main(String[] args) throws XRegistryClientException {
        /* Create database */<commit_msg>Reading the configurations form a properties file.<commit_after>package org.apache.airavata.migrator.registry;

import org.apache.airavata.common.registry.api.exception.RegistryException;
import org.apache.airavata.commons.gfac.type.ApplicationDeploymentDescription;
import org.apache.airavata.commons.gfac.type.HostDescription;
import org.apache.airavata.commons.gfac.type.ServiceDescription;
import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
import org.apache.xmlbeans.XmlException;
import org.ogce.schemas.gfac.beans.ApplicationBean;
import org.ogce.schemas.gfac.beans.HostBean;
import org.ogce.schemas.gfac.beans.ServiceBean;
import org.ogce.xregistry.client.XRegistryClient;
import org.ogce.xregistry.client.XRegistryClientUtil;
import org.ogce.xregistry.utils.XRegistryClientException;
import xregistry.generated.FindAppDescResponseDocument;
import xregistry.generated.HostDescData;
import xregistry.generated.ServiceDescData;

import javax.jcr.RepositoryException;
import javax.xml.namespace.QName;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

public class XRegistryMigrate {
//    private static String propertyfile = "xregistry.properties";
//    private static String propertyfile = "xregistry-dropbox.properties";
    private static String propertyfile = "xregistry-local.properties";
    private static AiravataJCRRegistry jcrRegistry = null;

    private static final String JCR_URL = "jcr.url";
    private static final String JCR_USERNAME = "jcr.username";
    private static final String JCR_PASSWORD = "<PASSWORD>";

    public static void main(String[] args) throws XRegistryClientException {
        Properties prop = new Properties();
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(propertyfile);
            prop.load(fis);
        } catch (FileNotFoundException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

        String jcrRegsitryURL = prop.getProperty(JCR_URL);
        String jcrUsername = prop.getProperty(JCR_USERNAME);
        String jcrPassword = prop.getProperty(JCR_PASSWORD);

        /* Create database */
{'fraction_non_alphanumeric': 0.09315589353612168, 'fraction_numerical': 0.0009505703422053232, 'mean_word_length': 4.845833333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4159523', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1182, 'n_words': 252}