<commit_before>package com.izforge.izpack.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.List;
import java.util.Properties;

import com.izforge.izpack.Pack;
import com.izforge.izpack.installer.AutomatedInstallData;
import com.izforge.izpack.installer.DataValidator;
import com.izforge.izpack.installer.DataValidator.Status;
import com.izforge.izpack.panels.ProcessingClient;
import com.izforge.izpack.panels.Validator;


public class X3WebServerValidator implements Validator
{

    public boolean validate(ProcessingClient client,AutomatedInstallData adata)
    {
        boolean bReturn = false;
        try
        {
        
            //String x3webPath = adata.getVariable("syracuse.certificate.x3webserver").trim();
            String x3webPath = client.getFieldContents(0).trim();
            
            
            
            File X3WebInstallInformation = new File (x3webPath+"/"+AutomatedInstallData.INSTALLATION_INFORMATION);
            if (X3WebInstallInformation.exists() && X3WebInstallInformation.isFile())
            {
                // we need to load it to find where is stored the data directory 
                
                
                FileInputStream fin = new FileInputStream(X3WebInstallInformation);
                ObjectInputStream oin = new ObjectInputStream(fin);
                List packsinstalled = (List) oin.readObject();
                Properties variables = (Properties) oin.readObject();                
                
                String strDataPath = variables.getProperty("webserver.dir.data");
                if (strDataPath!=null)
                {
                    adata.setVariable("syracuse.certificate.x3webserverdata", strDataPath + File.separator + "KEYSTORE" + File.separator + "WEBSERVER");
                    bReturn = true;
                }
                
                
            }
            
        }
        catch (Exception ex)
        {
            // got exception<commit_msg> fix directory for copyinh public key in webserver<commit_after>package com.izforge.izpack.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.ObjectInputStream;
import java.util.List;
import java.util.Properties;

import com.izforge.izpack.Pack;
import com.izforge.izpack.installer.AutomatedInstallData;
import com.izforge.izpack.installer.DataValidator;
import com.izforge.izpack.installer.DataValidator.Status;
import com.izforge.izpack.panels.ProcessingClient;
import com.izforge.izpack.panels.Validator;


public class X3WebServerValidator implements Validator
{

    public boolean validate(ProcessingClient client,AutomatedInstallData adata)
    {
        boolean bReturn = false;
        try
        {
        
            //String x3webPath = adata.getVariable("syracuse.certificate.x3webserver").trim();
            String x3webPath = client.getFieldContents(0).trim();
            
            
            
            File X3WebInstallInformation = new File (x3webPath+"/"+AutomatedInstallData.INSTALLATION_INFORMATION);
            if (X3WebInstallInformation.exists() && X3WebInstallInformation.isFile())
            {
                // we need to load it to find where is stored the data directory 
                
                
                FileInputStream fin = new FileInputStream(X3WebInstallInformation);
                ObjectInputStream oin = new ObjectInputStream(fin);
                List packsinstalled = (List) oin.readObject();
                Properties variables = (Properties) oin.readObject();                
                
                String strDataPath = variables.getProperty("webserver.dir.data");
                if (strDataPath!=null)
                {
                    adata.setVariable("syracuse.certificate.x3webserverdata", strDataPath + File.separator + "KEYSTORE" + File.separator + "SYRACUSE");
                    bReturn = true;
                }
                
                
            }
            
        }
        catch (Exception ex)
        {
            // got exception
{'fraction_non_alphanumeric': 0.08268482490272373, 'fraction_numerical': 0.005350194552529183, 'mean_word_length': 2.0087783467446965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '6957955', 'n_tokens_mistral': 1085, 'n_tokens_neox': 1034, 'n_words': 205}