<commit_before>/*
 * IzPack - Copyright 2001-2008 <NAME>, All Rights Reserved.
 *
 * http://izpack.org/
 * http://izpack.codehaus.org/
 *
 * Copyright 2004 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.izforge.izpack.data;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.izforge.izpack.api.data.Blockable;
import com.izforge.izpack.api.data.OverrideType;
import com.izforge.izpack.api.data.Pack;
import com.izforge.izpack.api.data.PackColor;
import com.izforge.izpack.api.data.PackFile;
import com.izforge.izpack.api.data.binding.OsModel;

/**
 * Temporary holding place for Pack information as the Packager is built. The packager is used by
 * the compiler to collect info about an installer, and finally create the actual installer files.
 *
 * @author <NAME>
 */
public class PackInfo implements Serializable
{

    /**
     *
     */
    private static final long serialVersionUID = -3604642858885697783L;

    /**
     * The pack object serialized in the installer.
     */
    private Pack pack;

    /**
     * The color of the node. This is used for the dependency graph algorithms
     */
    public PackColor colour;

    /**
     * Files of the Pack.
     */
    private Map<PackFile, File> files = new LinkedHashMap<PackFile, File>();

    /**
     * Parsables files in this Pack.
     */
    private List<ParsableFile> parsables = new ArrayList<ParsableFile>();

    /**
     * Executable files in this Pack.
     */
    private List<ExecutableFile> executables = new ArrayList<ExecutableFile>();

    /**
     * Update check specifications in this Pack.
     */
    private List<UpdateCheck> updateChecks = new ArrayList<UpdateCheck>();

    /**
     * Constructor with required info.
     *
     * @param name         name of the pack
     * @param id           id of the pack e.g. to resolve I18N
     * @param description  descripton in English
     * @param required     pack is required or not
     * @param loose        files of pack should be stored separatly or not
     * @param excludegroup name of the exclude group
     * @param uninstall    pack must be uninstalled
     * @param size         the size of the pack, in bytes
     */
    public PackInfo(String name, String id, String description, boolean required, boolean loose, String excludegroup,
                    boolean uninstall, long size)
    {
        boolean ispreselected = (excludegroup == null);
        pack = new Pack(name, id, description, null, null, required, ispreselected, loose, excludegroup, uninstall,
                        size);
        colour = PackColor.WHITE;
    }

    /**
     * ********************************************************************************************
     * Attributes of the Pack
     * ********************************************************************************************
     */

    public void setDependencies(List<String> dependencies)
    {
        pack.setDependencies(dependencies);
    }

    /**
     * Set the name of the group which contains the packs which exludes mutual.
     *
     * @param group name of the mutal exclude group
     */
    public void setExcludeGroup(String group)
    {
        pack.setExcludeGroup(group);
    }

    public void setOsConstraints(List<OsModel> osConstraints)
    {
        pack.setOsConstraints(osConstraints);
    }

    public List<OsModel> getOsConstraints(List osConstraints)
    {
        return pack.getOsConstraints();<commit_msg>IZPACK-1360: getter needs no parameter<commit_after>/*
 * IzPack - Copyright 2001-2008 <NAME>, All Rights Reserved.
 *
 * http://izpack.org/
 * http://izpack.codehaus.org/
 *
 * Copyright 2004 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.izforge.izpack.data;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.izforge.izpack.api.data.Blockable;
import com.izforge.izpack.api.data.OverrideType;
import com.izforge.izpack.api.data.Pack;
import com.izforge.izpack.api.data.PackColor;
import com.izforge.izpack.api.data.PackFile;
import com.izforge.izpack.api.data.binding.OsModel;

/**
 * Temporary holding place for Pack information as the Packager is built. The packager is used by
 * the compiler to collect info about an installer, and finally create the actual installer files.
 *
 * @author <NAME>
 */
public class PackInfo implements Serializable
{

    /**
     *
     */
    private static final long serialVersionUID = -3604642858885697783L;

    /**
     * The pack object serialized in the installer.
     */
    private Pack pack;

    /**
     * The color of the node. This is used for the dependency graph algorithms
     */
    public PackColor colour;

    /**
     * Files of the Pack.
     */
    private Map<PackFile, File> files = new LinkedHashMap<PackFile, File>();

    /**
     * Parsables files in this Pack.
     */
    private List<ParsableFile> parsables = new ArrayList<ParsableFile>();

    /**
     * Executable files in this Pack.
     */
    private List<ExecutableFile> executables = new ArrayList<ExecutableFile>();

    /**
     * Update check specifications in this Pack.
     */
    private List<UpdateCheck> updateChecks = new ArrayList<UpdateCheck>();

    /**
     * Constructor with required info.
     *
     * @param name         name of the pack
     * @param id           id of the pack e.g. to resolve I18N
     * @param description  descripton in English
     * @param required     pack is required or not
     * @param loose        files of pack should be stored separatly or not
     * @param excludegroup name of the exclude group
     * @param uninstall    pack must be uninstalled
     * @param size         the size of the pack, in bytes
     */
    public PackInfo(String name, String id, String description, boolean required, boolean loose, String excludegroup,
                    boolean uninstall, long size)
    {
        boolean ispreselected = (excludegroup == null);
        pack = new Pack(name, id, description, null, null, required, ispreselected, loose, excludegroup, uninstall,
                        size);
        colour = PackColor.WHITE;
    }

    /**
     * ********************************************************************************************
     * Attributes of the Pack
     * ********************************************************************************************
     */

    public void setDependencies(List<String> dependencies)
    {
        pack.setDependencies(dependencies);
    }

    /**
     * Set the name of the group which contains the packs which exludes mutual.
     *
     * @param group name of the mutal exclude group
     */
    public void setExcludeGroup(String group)
    {
        pack.setExcludeGroup(group);
    }

    public void setOsConstraints(List<OsModel> osConstraints)
    {
        pack.setOsConstraints(osConstraints);
    }

    @Deprecated
    public List<OsModel> getOsConstraints(List<OsModel> osConstraints)
    {
        return pack.getOsConstraints();
    }
    
    public List<OsModel> getOsConstraints()
    {
        return pack.getOsConstraints();
{'fraction_non_alphanumeric': 0.1285731090459946, 'fraction_numerical': 0.00917539113045524, 'mean_word_length': 2.914364640883978, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5404866', 'n_tokens_mistral': 2351, 'n_tokens_neox': 2225, 'n_words': 773}