<commit_before>/*
 * Copyright 2015 The OpenDCT Authors. All Rights Reserved
 *
 * 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 opendct.config;

import opendct.config.options.DeviceOption;
import opendct.config.options.DeviceOptionException;
import opendct.consumer.FFmpegSageTVConsumerImpl;
import opendct.consumer.RawSageTVConsumerImpl;
import opendct.consumer.SageTVConsumer;
import opendct.producer.HTTPProducer;
import opendct.producer.HTTPProducerImpl;
import opendct.producer.NIORTPProducerImpl;
import opendct.producer.RTPProducer;
import opendct.util.Util;
import opendct.video.rtsp.DCTRTSPClientImpl;
import opendct.video.rtsp.RTSPClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.*;
import java.net.InetAddress;
import java.util.*;

public class Config {
    private static final Logger logger = LogManager.getLogger(Config.class);

    public static final int VERSION_MAJOR = 0;
    public static final int VERSION_MINOR = 4;
    public static final int VERSION_BUILD = 2;
    public static final String VERSION = VERSION_MAJOR + "." + VERSION_MINOR + "." + VERSION_BUILD;

    private static final Object getSocketServerPort = new Object();
    private static final Object getRTSPPort = new Object();
    private static Properties properties = new Properties();
    private static volatile boolean isConfigOnly = false;
    private static volatile boolean isShutdown = false;
    private static final HashMap<Integer, String> rtspPortMap = new HashMap<>();

    public static final OSVersion OS_VERSION = getOsVersion();
    public static final boolean IS_WINDOWS = (OS_VERSION == OSVersion.WINDOWS);
    public static final boolean IS_LINUX = (OS_VERSION == OSVersion.LINUX);
    public static final boolean IS_MAC = (OS_VERSION == OSVersion.MAC);
    public static final String NEW_LINE = System.lineSeparator();
    public static final String DIR_SEPARATOR = File.separator;

    private static int exitCode = 0;

    private static final String configFileName = "opendct.properties";

    // We should be using this any time we are converting text to bytes.
    public static final String STD_BYTE = "UTF-8";

    private static String directory;

    public static String getConfigDirectory() {
        return Config.directory;
    }

    public static String getDefaultConfigFilename() {<commit_msg>Incremented version.<commit_after>/*
 * Copyright 2015 The OpenDCT Authors. All Rights Reserved
 *
 * 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 opendct.config;

import opendct.config.options.DeviceOption;
import opendct.config.options.DeviceOptionException;
import opendct.consumer.FFmpegSageTVConsumerImpl;
import opendct.consumer.RawSageTVConsumerImpl;
import opendct.consumer.SageTVConsumer;
import opendct.producer.HTTPProducer;
import opendct.producer.HTTPProducerImpl;
import opendct.producer.NIORTPProducerImpl;
import opendct.producer.RTPProducer;
import opendct.util.Util;
import opendct.video.rtsp.DCTRTSPClientImpl;
import opendct.video.rtsp.RTSPClient;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.*;
import java.net.InetAddress;
import java.util.*;

public class Config {
    private static final Logger logger = LogManager.getLogger(Config.class);

    public static final int VERSION_MAJOR = 0;
    public static final int VERSION_MINOR = 4;
    public static final int VERSION_BUILD = 3;
    public static final String VERSION = VERSION_MAJOR + "." + VERSION_MINOR + "." + VERSION_BUILD;

    private static final Object getSocketServerPort = new Object();
    private static final Object getRTSPPort = new Object();
    private static Properties properties = new Properties();
    private static volatile boolean isConfigOnly = false;
    private static volatile boolean isShutdown = false;
    private static final HashMap<Integer, String> rtspPortMap = new HashMap<>();

    public static final OSVersion OS_VERSION = getOsVersion();
    public static final boolean IS_WINDOWS = (OS_VERSION == OSVersion.WINDOWS);
    public static final boolean IS_LINUX = (OS_VERSION == OSVersion.LINUX);
    public static final boolean IS_MAC = (OS_VERSION == OSVersion.MAC);
    public static final String NEW_LINE = System.lineSeparator();
    public static final String DIR_SEPARATOR = File.separator;

    private static int exitCode = 0;

    private static final String configFileName = "opendct.properties";

    // We should be using this any time we are converting text to bytes.
    public static final String STD_BYTE = "UTF-8";

    private static String directory;

    public static String getConfigDirectory() {
        return Config.directory;
    }

    public static String getDefaultConfigFilename() {
{'fraction_non_alphanumeric': 0.07466804621486463, 'fraction_numerical': 0.005173305742369374, 'mean_word_length': 4.355493998153278, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '963533', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1568, 'n_words': 563}