initialize the value of its options from a InputStream
of a jcseg.properties prperties file

@param   is
@throws  IOException
557858
public void load( InputStream is ) throws IOException
    {
        Properties lexPro = new Properties();
        lexPro.load(new BufferedInputStream(is));
        
        //about the lexicon, the lexicon path
        String lexDirs = lexPro.getProperty("lexicon.path");
        if ( lexDirs == null ) {
            throw new IOException("Missing lexicon.path property in jcseg.properties file!!!");
        }
        
        if ( ! "null".equalsIgnoreCase(lexDirs) ) {
            if ( lexDirs.indexOf("{jar.dir}") > -1 ) {
                lexDirs = lexDirs.replace("{jar.dir}", Util.getJarHome(this));
            }
            
            //Multiple path for lexicon.path.
            lexPath = lexDirs.split(";");
            File f  = null;
            for ( int i = 0; i < lexPath.length; i++ ) {
                lexPath[i] = java.net.URLDecoder.decode(lexPath[i], "UTF-8");
                f = new File(lexPath[i]);
                if ( ! f.exists() ) {
                    throw new IOException("Invalid sub lexicon path " + lexPath[i] 
                            + " for lexicon.path in jcseg.properties");
                }
                f = null;    //Let gc do its work
            }
        }
        
        //reset all the options
        if ( lexPro.getProperty("jcseg.maxlen") != null )
            MAX_LENGTH = Integer.parseInt(lexPro.getProperty("jcseg.maxlen"));
        if ( lexPro.getProperty("jcseg.icnname") != null
                && lexPro.getProperty("jcseg.icnname").equals("1"))
            I_CN_NAME = true;
        if ( lexPro.getProperty("jcseg.cnmaxlnadron") != null )
            MAX_CN_LNADRON = Integer.parseInt(lexPro.getProperty("jcseg.cnmaxlnadron"));
        if ( lexPro.getProperty("jcseg.nsthreshold") != null )
            NAME_SINGLE_THRESHOLD = Integer.parseInt(lexPro.getProperty("jcseg.nsthreshold"));
        if ( lexPro.getProperty("jcseg.pptmaxlen") != null ) 
            PPT_MAX_LENGTH = Integer.parseInt(lexPro.getProperty("jcseg.pptmaxlen"));
        if ( lexPro.getProperty("jcseg.loadpinyin") != null
                && lexPro.getProperty("jcseg.loadpinyin").equals("1")) 
            LOAD_CJK_PINYIN = true;
        if ( lexPro.getProperty("jcseg.loadsyn") != null
                && lexPro.getProperty("jcseg.loadsyn").equals("1") )
            LOAD_CJK_SYN = true;
        if ( lexPro.getProperty("jcseg.loadpos") != null
                && lexPro.getProperty("jcseg.loadpos").equals("1")) 
            LOAD_CJK_POS = true;
        if ( lexPro.getProperty("jcseg.loadentity") != null
                && lexPro.getProperty("jcseg.loadentity").equals("0")) 
            LOAD_CJK_ENTITY = false;
        if ( lexPro.getProperty("jcseg.loadparameter") != null
                && lexPro.getProperty("jcseg.loadparameter").equals("0")) 
            LOAD_PARAMETER = false;
        if ( lexPro.getProperty("jcseg.clearstopword") != null
                && lexPro.getProperty("jcseg.clearstopword").equals("1"))
            CLEAR_STOPWORD = true;
        if ( lexPro.getProperty("jcseg.cnnumtoarabic") != null
                && lexPro.getProperty("jcseg.cnnumtoarabic").equals("0"))
            CNNUM_TO_ARABIC = false;
        if ( lexPro.getProperty("jcseg.cnfratoarabic") != null
                && lexPro.getProperty("jcseg.cnfratoarabic").equals("0"))
            CNFRA_TO_ARABIC = false;
        if ( lexPro.getProperty("jcseg.keepunregword") != null
                && lexPro.getProperty("jcseg.keepunregword").equals("1"))
            KEEP_UNREG_WORDS = true;
        if ( lexPro.getProperty("lexicon.autoload") != null
                && lexPro.getProperty("lexicon.autoload").equals("1"))
            lexAutoload = true;
        if ( lexPro.getProperty("lexicon.polltime") != null )
            polltime = Integer.parseInt(lexPro.getProperty("lexicon.polltime"));
        
        //secondary split
        if ( lexPro.getProperty("jcseg.ensencondseg") != null
                && lexPro.getProperty("jcseg.ensencondseg").equals("0"))
            EN_SECOND_SEG = false;
        if ( lexPro.getProperty("jcseg.stokenminlen") != null )
            STOKEN_MIN_LEN = Integer.parseInt(lexPro.getProperty("jcseg.stokenminlen"));
        
        //load the keep punctuation
        if ( lexPro.getProperty("jcseg.keeppunctuations") != null )
            KEEP_PUNCTUATIONS = lexPro.getProperty("jcseg.keeppunctuations");
    }
1073238
public void initializeWithPropertiesFilename(String filename) throws ProbeHandlerConfigException {

    InputStream is;
    // try to load the properties file off the classpath first

    if (ConfigFileProbeHandlerPlugin.class.getResource(filename) != null) {
      is = ConfigFileProbeHandlerPlugin.class.getResourceAsStream(filename);
    } else {
      try {
        is = new FileInputStream(filename);
      } catch (FileNotFoundException e) {
        throw new ProbeHandlerConfigException("Error loading handler config for [" + this.getClass().getName() + "]", e);
      }
    }

    try {
      config.load(is);
    } catch (IOException e) {
      throw new ProbeHandlerConfigException("Error loading handler config for [" + this.getClass().getName() + "]", e);
    } finally {
      try {
        is.close();
      } catch (IOException e) {
        throw new ProbeHandlerConfigException("Error closing handler config for {" + this.getClass().getName() + "]", e);
      }
    }

    // Launch the timer task that will look for changes to the config file
    try {
      configFileScan = new Timer();
      configFileScan.scheduleAtFixedRate(new ConfigFileMonitorTask(this), 100, 10000);
    } catch (ConfigurationException e) {
      throw new ProbeHandlerConfigException("Error initializing monitor task.", e);
    }

  }
1245855
protected void loadDataFromFile(InputStream is) throws IOException {
		PHPFileParser fp = new PHPFileParser(is);
		createInternalDataStructre(fp.getSections());
	}
1071486
public void setStreamValueAsCLIString(String s){
        streamOption.setValueViaCLIString(s);
        editComponents.get(0).setEditState(streamOption.getValueAsCLIString());
    }
889889
public static synchronized final void init ( Properties props ) throws CIFSException {
        if ( INSTANCE != null ) {
            throw new CIFSException("Singleton context is already initialized");
        }
        Properties p = new Properties();
        try {
            String filename = System.getProperty("jcifs.properties");
            if ( filename != null && filename.length() > 1 ) {

                try ( FileInputStream in = new FileInputStream(filename) ) {
                    p.load(in);
                }
            }

        }
        catch ( IOException ioe ) {
            log.error("Failed to load config", ioe); //$NON-NLS-1$
        }
        p.putAll(System.getProperties());
        if ( props != null ) {
            p.putAll(props);
        }
        INSTANCE = new SingletonContext(p);
    }
1330857
@SuppressWarnings("checkstyle:cyclomaticcomplexity")
	private static String initializePersistedSREs() {
		//		// FOR DEBUG
		//		try {
		//			clearSREConfiguration();
		//		} catch (CoreException e1) {
		//			e1.printStackTrace();
		//		}
		final String rawXml = SARLEclipsePlugin.getDefault().getPreferences().get(
				getCurrentPreferenceKey(), ""); //$NON-NLS-1$

		try {
			Element config = null;
			// If the preference was found, load SREs from it into memory
			if (!Strings.isNullOrEmpty(rawXml)) {
				config = parseXML(rawXml, true);
			} else {
				// Otherwise, look for the old file that previously held the SRE definitions
				final SARLEclipsePlugin plugin = SARLEclipsePlugin.getDefault();
				if (plugin.getBundle() != null) {
					final IPath stateLocation = plugin.getStateLocation();
					final IPath stateFile = stateLocation.append("sreConfiguration.xml"); //$NON-NLS-1$
					final File file = stateFile.toFile();
					if (file.exists()) {
						// If file exists, load SRE definitions from it into memory and
						// write the definitions to the preference store WITHOUT triggering
						// any processing of the new value
						try (InputStream fileInputStream = new BufferedInputStream(new FileInputStream(file))) {
							config = parseXML(fileInputStream, true);
						} catch (IOException e) {
							SARLEclipsePlugin.getDefault().log(e);
						}
					}
				}
			}
			if (config != null) {
				final String defaultId = config.getAttribute("defaultSRE"); //$NON-NLS-1$
				final NodeList children = config.getChildNodes();
				for (int i = 0; i < children.getLength(); ++i) {
					try {
						final Node child = children.item(i);
						if ("SRE".equalsIgnoreCase(child.getNodeName()) //$NON-NLS-1$
								&& child instanceof Element) {
							final Element element = (Element) child;
							final boolean isPlatform = Boolean.parseBoolean(element.getAttribute("platform")); //$NON-NLS-1$
							final String id = element.getAttribute("id"); //$NON-NLS-1$
							if (!isPlatform || !(ALL_SRE_INSTALLS.containsKey(id))) {
								final ISREInstall sre = createSRE(
										element.getAttribute("class"), //$NON-NLS-1$
										id);
								if (sre == null) {
									throw new IOException("Invalid XML format of the SRE preferences of " + id); //$NON-NLS-1$
								}
								try {
									sre.setFromXML(element);
								} catch (IOException e) {
									SARLEclipsePlugin.getDefault().log(e);
								}
								ALL_SRE_INSTALLS.put(id, sre);
								if (isPlatform) {
									platformSREInstalls.add(id);
								}
							} else {
								final ISREInstall sre = ALL_SRE_INSTALLS.get(id);
								if (sre != null) {
									try {
										sre.setFromXML(element);
									} catch (IOException e) {
										SARLEclipsePlugin.getDefault().log(e);
									}
								}
							}
						}
					} catch (IOException e) {
						SARLEclipsePlugin.getDefault().log(e);
					}
				}
				return defaultId;
			}
		} catch (IOException e) {
			SARLEclipsePlugin.getDefault().log(e);
		}
		return null;
	}
1236615
private void initialize(@NotNull final String propertiesFilePath) {
        props = new Properties();
        try (InputStream in = FileUtils.getResourceAsStream(propertiesFilePath)) {
            props.load(in);
        } catch (NullPointerException ex) {
            LOGGER.error("Did not find settings file '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        } catch (IOException ex) {
            LOGGER.error("Unable to load settings from '{}'.", propertiesFilePath);
            LOGGER.debug("", ex);
        }
        logProperties("Properties loaded", props);
    }
435856
public void setInput(int index, InputStream is) {
        if (index >= inputStreams.length) {
            inputStreams = Arrays.copyOf(inputStreams, index + 1);
        }
        this.inputStreams[index] = is;
    }
1308934
public void readFrom(java.io.InputStream is) throws IOException {
        int howmuch = 0;
        do {
            _write_pos += howmuch;
            moveWindow(_write_pos);
            howmuch = is.read(_memory_buffer);
        } while (howmuch != -1);
    }
944858
public void dump(OutputStream out) throws IOException {

        Properties props = new Properties();
        Iterator<String> iter = _map.keySet().iterator();
        while (iter.hasNext()) {
            String key = iter.next();
            props.setProperty(key, getValue(key));
        }

        props.store(out, "Install Options");
    }
645664
private void initialize() throws IllegalArgumentException,
			IllegalAccessException {
		Field[] fields = this.getClass().getFields();
		for (Field f : fields) {
			if (this.getProperty(f.getName()) == null) {
				System.err.print("Property '" + f.getName()
						+ "' not defined in config file");
			}
			if (f.getType().equals(String.class)) {
				f.set(this, this.getProperty(f.getName()));
			} else if (f.getType().equals(long.class)) {
				f.setLong(this, Long.valueOf(this.getProperty(f.getName())));
			} else if (f.getType().equals(int.class)) {
				f.setInt(this, Integer.valueOf(this.getProperty(f.getName())));
			} else if (f.getType().equals(boolean.class)) {
				f.setBoolean(this,
						Boolean.valueOf(this.getProperty(f.getName())));
			} else if (f.getType().equals(String[].class)) {
				f.set(this, this.getProperty(f.getName()).split(";"));
			} else if (f.getType().equals(int[].class)) {
				String[] tmp = this.getProperty(f.getName()).split(";");
				int[] ints = new int[tmp.length];
				for (int i = 0; i < tmp.length; i++) {
					ints[i] = Integer.parseInt(tmp[i]);
				}
				f.set(this, ints);
			} else if (f.getType().equals(long[].class)) {
				String[] tmp = this.getProperty(f.getName()).split(";");
				long[] longs = new long[tmp.length];
				for (int i = 0; i < tmp.length; i++) {
					longs[i] = Long.parseLong(tmp[i]);
				}
				f.set(this, longs);
			}
		}
	}
1103104
public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String, Object> properties)
    {
        super.init(itsLocation, parentScreen, fieldConverter, iDisplayFieldDesc, properties);
        for (int iIndex = 0; iIndex < 32; iIndex++)
        {
            Object icon = this.getIcon(iIndex);
            if (icon == null)
                break;
            this.addIcon(icon, iIndex);
        }
    }
149735
public void init(ScreenLocation itsLocation, BasePanel parentScreen, Converter fieldConverter, int iDisplayFieldDesc, Map<String, Object> properties)
    {
        String strValue = null;
        String strDesc = null;
        String strImage = null;
        String strCommand = null;
        String strToolTip = null;
        Record record = null;
        BaseField field = null;
        if (properties != null)
        {
            strValue = (String)properties.get(ScreenModel.VALUE);
            strDesc = (String)properties.get(ScreenModel.DESC);
            strImage = (String)properties.get(ScreenModel.IMAGE);
            strCommand = (String)properties.get(ScreenModel.COMMAND);
            strToolTip = (String)properties.get(ScreenModel.TOOLTIP);
            record = (Record)properties.get(ScreenModel.RECORD);
            field = (BaseField)properties.get(ScreenModel.FIELD);          
        }
        
        this.init((ScreenLocation)itsLocation, (BasePanel)parentScreen, (Converter)fieldConverter, iDisplayFieldDesc, strValue, strDesc, strImage, strCommand, strToolTip, record, field);
    }
1065986
public void storeProperties(Map<String, String> properties) throws IOException {
        Properties props = new Properties();
        properties.forEach(props::setProperty);
        try (FileOutputStream out = new FileOutputStream(getPropertiesFile())) {
            props.store(out, "");
        }
    }
845952
private static void initializePropertiesIfNeeded() {
        if (translationResources != null) {
            return;
        }
        String lastException = "";
        try {
            translationResources = new Properties();
            ClassLoader classLoader = ClassLoader.getSystemClassLoader();
            translationResources.load(classLoader.getResourceAsStream(
                    propertiesFileName));
        } catch (Exception exception) {
            lastException = exception.toString() + "\n----\n" + exception.getMessage();
        }
        if (translationResources == null) {
            throw new RuntimeException("TranslationSource.initializePropertiesIfNeeded()"
                    + "Could not load TranslationResources.properties file.\n"
                    + "The exception follows:\n" + lastException);
        }
    }
679552
private void initValues() throws VarExploderException
    {

        Class<?> c = source.getClass();
        if (c.isAnnotation() || c.isArray() || c.isEnum() || c.isPrimitive())
        {
            throw new IllegalArgumentException("The value must an object");
        }

        if(source instanceof Map )
        {
            this.pairs = (Map<String,Object>) source;
            return;
        }
        Method[] methods = c.getMethods();
        for (Method method : methods)
        {
            inspectGetters(method);
        }
        scanFields(c);
    }
584849
private void initializeProperties(
        Class<?> type, Object oldInstance, Encoder encoder)
    {
        BeanInfo info = null;
        try
        {
            info = Introspector.getBeanInfo(type);
        }
        catch (IntrospectionException ie)
        {
            encoder.getExceptionListener().exceptionThrown(ie);
            return;
        }
        PropertyDescriptor[] pds = info.getPropertyDescriptors();
        for (int i = 0; i < pds.length; ++i)
        {
            try
            {
                initializeProperty(type, pds[i], oldInstance, encoder);
            }
            catch (Exception e)
            {
                encoder.getExceptionListener().exceptionThrown(e);
            }
        }
    }