mil.dod.th.ose.controller/src/mil/dod/th/ose/controller/impl/TerraHarvestControllerImpl.java
private void loadProperties(final BundleContext context)
    {
        final String configDirectory = context.getProperty(SystemConfigurationConstants.DATA_DIR_PROPERTY);
        final File configParentFile = new File(configDirectory, "conf");
        m_PropFile = new File(configParentFile, PROP_FILE_NAME);
        
        m_FileService.mkdir(configParentFile);
        
        if (m_FileService.doesFileExist(m_PropFile))
        {
            try (FileInputStream inputStream = m_FileService.createFileInputStream(m_PropFile))
            {
                m_Prop.load(inputStream);
            }
            catch (final IOException ex)
            {
                m_Logging.error(ex, "Error in loading properties from file");
            }
        }
        
        // read in initial values into fields
        final String id = m_Prop.getProperty(ID_KEY);
        if (id == null)
        {
            m_Logging.warning("Controller id not set, initializing to default");
            setId(0);
        }
        else
        {
            try
            {
                m_Id = Integers.parseHexOrDecimal(id);
            }
            catch (final NumberFormatException e)
            {
                m_Logging.warning("Unable to parse id from [%s]", id);
                setId(-1);
            }
        }
        
        m_Name = m_Prop.getProperty(NAME_KEY);
        if (m_Name == null)
        {
            m_Logging.warning("Controller name not set, initializing to default");
            setName("<undefined>");
        }
        
        final String mode = m_Prop.getProperty(OPERATION_MODE_KEY);
        if (mode == null)
        {
            m_Logging.warning("Controller operation mode not set, initializing to default");
            setOperationMode(OperationMode.TEST_MODE);
        }
        else
        {
            try
            {
                m_OperationMode = OperationMode.fromValue(mode);
            }
            catch (final IllegalArgumentException e)
            {
                m_Logging.warning("Unable to parse mode from [%s]", mode);
                setOperationMode(OperationMode.TEST_MODE);
            }
        }        
    }
/**
     * Load properties from the {@link #PROP_FILE_NAME} and initial fields with values. If values are not set in file,
     * initialize with default values.
     * 
     * @param context
     *      context for the bundle containing this component
     */
Load properties from the  #PROP_FILE_NAME and initial fields with values. If values are not set in file,
initialize with default values.

@param context
context for the bundle containing this component
Load properties from the #PROP_FILE_NAME and initial fields with values . If values are not set in file initialize with default values . @param context context for the bundle containing this component
private void loadProperties(final BundleContext context)
    {
        final String configDirectory = context.getProperty(SystemConfigurationConstants.DATA_DIR_PROPERTY);
        final File configParentFile = new File(configDirectory, "conf");
        m_PropFile = new File(configParentFile, PROP_FILE_NAME);
        m_FileService.mkdir(configParentFile);
        if (m_FileService.doesFileExist(m_PropFile))
        {
            try (FileInputStream inputStream = m_FileService.createFileInputStream(m_PropFile))
            {
                m_Prop.load(inputStream);
            }
            catch (final IOException ex)
            {
                m_Logging.error(ex, "Error in loading properties from file");
            }
        }
        final String id = m_Prop.getProperty(ID_KEY);
        if (id == null)
        {
            m_Logging.warning("Controller id not set, initializing to default");
            setId(0);
        }
        else
        {
            try
            {
                m_Id = Integers.parseHexOrDecimal(id);
            }
            catch (final NumberFormatException e)
            {
                m_Logging.warning("Unable to parse id from [%s]", id);
                setId(-1);
            }
        }
        m_Name = m_Prop.getProperty(NAME_KEY);
        if (m_Name == null)
        {
            m_Logging.warning("Controller name not set, initializing to default");
            setName("<undefined>");
        }
        final String mode = m_Prop.getProperty(OPERATION_MODE_KEY);
        if (mode == null)
        {
            m_Logging.warning("Controller operation mode not set, initializing to default");
            setOperationMode(OperationMode.TEST_MODE);
        }
        else
        {
            try
            {
                m_OperationMode = OperationMode.fromValue(mode);
            }
            catch (final IllegalArgumentException e)
            {
                m_Logging.warning("Unable to parse mode from [%s]", mode);
                setOperationMode(OperationMode.TEST_MODE);
            }
        }        
    }
private void loadProperties ( final BundleContext context ) { final String configDirectory = context . getProperty ( SystemConfigurationConstants . DATA_DIR_PROPERTY ) ; final File configParentFile = new File ( configDirectory , "conf" ) ; m_PropFile = new File ( configParentFile , PROP_FILE_NAME ) ; m_FileService . mkdir ( configParentFile ) ; if ( m_FileService . doesFileExist ( m_PropFile ) ) { try ( FileInputStream inputStream = m_FileService . createFileInputStream ( m_PropFile ) ) { m_Prop . load ( inputStream ) ; } catch ( final IOException ex ) { m_Logging . error ( ex , "Error in loading properties from file" ) ; } } final String id = m_Prop . getProperty ( ID_KEY ) ; if ( id == null ) { m_Logging . warning ( "Controller id not set, initializing to default" ) ; setId ( 0 ) ; } else { try { m_Id = Integers . parseHexOrDecimal ( id ) ; } catch ( final NumberFormatException e ) { m_Logging . warning ( "Unable to parse id from [%s]" , id ) ; setId ( - 1 ) ; } } m_Name = m_Prop . getProperty ( NAME_KEY ) ; if ( m_Name == null ) { m_Logging . warning ( "Controller name not set, initializing to default" ) ; setName ( "<undefined>" ) ; } final String mode = m_Prop . getProperty ( OPERATION_MODE_KEY ) ; if ( mode == null ) { m_Logging . warning ( "Controller operation mode not set, initializing to default" ) ; setOperationMode ( OperationMode . TEST_MODE ) ; } else { try { m_OperationMode = OperationMode . fromValue ( mode ) ; } catch ( final IllegalArgumentException e ) { m_Logging . warning ( "Unable to parse mode from [%s]" , mode ) ; setOperationMode ( OperationMode . TEST_MODE ) ; } } }
Load properties from the {@link #PROP_FILE_NAME} and initial fields with values.
Load properties from the { @link #PROP_FILE_NAME } and initial fields with values .
// read in initial values into fields