Read a text based configuration file out of the force field mm2 file

@exception  Exception  Description of the Exception
12127
private void setForceFieldDefinitions() throws Exception {
        String sid = st.nextToken();
        String svalue = st.nextToken();
        if (sid.equals(">bontunit")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">bond-cubic")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">bond-quartic")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">angleunit")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">angle-sextic")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">strbndunit")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">opbendunit")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">torsionunit")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">vdwtype")) {
            key = sid.substring(1);
            //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
            parameterSet.put(key, svalue);
        } else if (sid.equals(">radiusrule")) {
            key = sid.substring(1);
            //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
            parameterSet.put(key, svalue);
        } else if (sid.equals(">radiustype")) {
            key = sid.substring(1);
            //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
            parameterSet.put(key, svalue);
        } else if (sid.equals(">radiussize")) {
            key = sid.substring(1);
            //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
            parameterSet.put(key, svalue);
        } else if (sid.equals(">epsilonrule")) {
            key = sid.substring(1);
            //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
            parameterSet.put(key, svalue);
        } else if (sid.equals(">a-expterm")) {
            try {
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, svalue);
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals("b-expterm")) {
            try {
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, svalue);
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">c-expterm")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">vdw-14-scale")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">chg-14-scale")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else if (sid.equals(">dielectric")) {
            try {
                double value1 = new Double(svalue).doubleValue();
                key = sid.substring(1);
                //if (parameterSet.containsKey(key)){logger.debug("KeyError: hasKey "+key);}
                parameterSet.put(key, new Double(value1));
            } catch (NumberFormatException nfe) {
                throw new IOException("VdWaalsTable.ReadvdWaals: " + "Malformed Number");
            }
        } else {
        }
    }
1369731
public void readParameterSets(IChemObjectBuilder builder) throws Exception {
        //vdW,vdWp,bond,bond4,bond3,angle,angle4,angle3,
        //strbond,opbend,torsion,torsion4,charge,dipole,
        //dipole3,piatom,pibond,dipole3
        //logger.debug("------ ReadParameterSets ------");

        if (ins == null) {
            ins = getClass().getClassLoader().getResourceAsStream(configFile);
        }
        if (ins == null) {
            throw new IOException("There was a problem getting the default stream: " + configFile);
        }

        // read the contents from file
        BufferedReader r = new BufferedReader(new InputStreamReader(ins), 1024);
        String s;
        int[] a = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
        try {
            while (true) {
                s = r.readLine();
                if (s == null) {
                    break;
                }
                st = new StringTokenizer(s, "\t ;");
                int nt = st.countTokens();
                if (s.startsWith(">") & nt > 1) {
                    setForceFieldDefinitions();
                    a[0]++;
                } else if (s.startsWith("atom") & nt <= 8) {
                    a[0]++;
                    setAtomTypes(builder);
                } else if (s.startsWith("vdw ") & nt <= 5) {
                    setvdWaals();
                    a[1]++;
                } else if (s.startsWith("vdwpr ") & nt <= 6) {
                    setvdWaalpr();
                    a[2]++;
                } else if (s.startsWith("bond ") & nt <= 7) {
                    setBond();
                    a[3]++;
                } else if (s.startsWith("bond4 ") & nt == 5) {
                    setBond4();
                    a[4]++;
                } else if (s.startsWith("bond3 ") & nt == 5) {
                    setBond3();
                    a[5]++;
                } else if (s.startsWith("angle ") & nt == 8) {
                    setAngle();
                    a[6]++;
                } else if (s.startsWith("angle4 ") & nt == 8) {
                    setAngle4();
                    a[17]++;
                } else if (s.startsWith("angle3 ") & nt == 8) {
                    setAngle3();
                    a[7]++;
                } else if (s.startsWith("strbnd ") & nt == 5) {
                    setStrBnd();
                    a[8]++;
                } else if (s.startsWith("opbend ") & nt == 4) {
                    setOpBend();
                    a[9]++;
                } else if (s.startsWith("torsion ") & nt == 14) {
                    setTorsion();
                    a[10]++;
                } else if (s.startsWith("torsion4 ") & nt == 14) {
                    setTorsion4();
                    a[11]++;
                } else if (s.startsWith("charge ") & nt == 3) {
                    setCharge();
                    a[12]++;
                } else if (s.startsWith("dipole ") & nt == 5) {
                    setDipole();
                    a[13]++;
                } else if (s.startsWith("dipole3 ") & nt == 5) {
                    setDipole3();
                    a[14]++;
                } else if (s.startsWith("piatom ") & nt == 5) {
                    setPiAtom();
                    a[15]++;
                } else if (s.startsWith("pibond ") & nt == 5) {
                    setPiBond();
                    a[16]++;
                }
            }// end while
            ins.close();
        } catch (IOException e) {
            throw new IOException("There was a problem parsing the mm2 forcefield due to:" + e.toString());
        }
    }
118733
public static function read($file, $force = false) {
        if (!is_readable($file)) {
            if ($force === true) {
                return [];
            } else {
                throw new Exception(sprintf(
                    'Unable to read file "%s"',
                    $file
                ), ExitApp::RUNTIME_ERROR);
            }
        }

        $fileContent = file_get_contents($file);

        if ($fileContent === false) {
            throw new Exception(sprintf(
                'Unable to read file "%s"',
                $file
            ), ExitApp::RUNTIME_ERROR);
        }

        $result = json_decode(
            trim($fileContent),
            true
        );

        if ($result === false) {
            throw new Exception(sprintf(
                'File "%s" contains invalid JSON data.',
                ExitApp::RUNTIME_ERROR
            ));
        }

        return $result;
    }
729961
public Campaign readFile(String fileName) throws Exception {
        Campaign result = new Campaign();

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(fileName);
        doc.getDocumentElement().normalize();

        Element el = doc.getDocumentElement();
        if (!el.getNodeName().equals("campaign")) {
            throw new Exception(fileName + " is not a valid xml campain file");
        }

        result.name = el.getAttributeNode("name").getValue();

        NodeList nodeLst = doc.getElementsByTagName("run");
        for (int s = 0; s < nodeLst.getLength(); s++) {
            Node node = nodeLst.item(s);
            if (node.getNodeType() == Node.ELEMENT_NODE) {
                Element element = (Element) node;
                CampaignRun run = new CampaignRun();
                run.testbed = element.getAttribute("testbed");
                result.runs.add(run);
                NodeList nodeList = element.getElementsByTagName("testsuite");

                for (int t = 0; t < nodeList.getLength(); t++) {
                    TestSuiteParams params = new TestSuiteParams();

                    run.testsuites.add(params);
                    params.setDirectory(nodeList.item(t).getAttributes().getNamedItem("directory").getNodeValue());

                    NodeList childList = nodeList.item(t).getChildNodes();
                    for (int c = 0; c < childList.getLength(); c++) {
                        Node childNode = childList.item(c);
                        if (childNode.getNodeName().equals("testdata")) {
                            String selectorStr = childNode.getAttributes().getNamedItem("selector").getNodeValue();
                            String[] selectedRowsStr = selectorStr.split(",");
                            TreeSet<Integer> selectedRows = new TreeSet<>();
                            for (String selectedRowStr : selectedRowsStr) {
                                selectedRows.add(Integer.parseInt(selectedRowStr));
                            }
                            params.setDataRows(selectedRows);
                        }
                        if (childList.item(c).getNodeName().equals("loopInHours")) {
                            params.setLoopInHours(true);
                        }

                        if (childList.item(c).getNodeName().equals("count")) {
                            try {
                                params.setCount(Integer.parseInt(childList.item(c).getTextContent()));
                            } catch (NumberFormatException e) {
                                logger.error("count field in " + fileName + " file should be numeric");
                            }
                        }
                    }
                }
            }
        }
        return result;
    }
762779
private void parseFile(File file) throws Exception {
        int lineNumber = 1;
        String line = null;
        BufferedReader in = null;
        try {
            in = new BufferedReader(new FileReader(file));
            List<TZDBZone> openZone = null;
            for ( ; (line = in.readLine()) != null; lineNumber++) {
                int index = line.indexOf('#');  // remove comments (doesn't handle # in quotes)
                if (index >= 0) {
                    line = line.substring(0, index);
                }
                if (line.trim().length() == 0) {  // ignore blank lines
                    continue;
                }
                StringTokenizer st = new StringTokenizer(line, " \t");
                if (openZone != null && Character.isWhitespace(line.charAt(0)) && st.hasMoreTokens()) {
                    if (parseZoneLine(st, openZone)) {
                        openZone = null;
                    }
                } else {
                    if (st.hasMoreTokens()) {
                        String first = st.nextToken();
                        if (first.equals("Zone")) {
                            if (st.countTokens() < 3) {
                                printVerbose("Invalid Zone line in file: " + file + ", line: " + line);
                                throw new IllegalArgumentException("Invalid Zone line");
                            }
                            openZone = new ArrayList<TZDBZone>();
                            zones.put(st.nextToken(), openZone);
                            if (parseZoneLine(st, openZone)) {
                                openZone = null;
                            }
                        } else {
                            openZone = null;
                            if (first.equals("Rule")) {
                                if (st.countTokens() < 9) {
                                    printVerbose("Invalid Rule line in file: " + file + ", line: " + line);
                                    throw new IllegalArgumentException("Invalid Rule line");
                                }
                                parseRuleLine(st);

                            } else if (first.equals("Link")) {
                                if (st.countTokens() < 2) {
                                    printVerbose("Invalid Link line in file: " + file + ", line: " + line);
                                    throw new IllegalArgumentException("Invalid Link line");
                                }
                                String realId = st.nextToken();
                                String aliasId = st.nextToken();
                                links.put(aliasId, realId);

                            } else {
                                throw new IllegalArgumentException("Unknown line");
                            }
                        }
                    }
                }
            }
        } catch (Exception ex) {
            throw new Exception("Failed while processing file '" + file + "' on line " + lineNumber + " '" + line + "'", ex);
        } finally {
            if (in != null) {
                in.close();
            }
        }
    }
1034323
@SuppressWarnings("unchecked")
	private void initInputReaders() throws Exception {
		int numGates = 0;
		//  ---------------- create the input readers ---------------------
		// in case where a logical input unions multiple physical inputs, create a union reader
		final int groupSize = this.config.getGroupSize(0);
		numGates += groupSize;
		if (groupSize == 1) {
			// non-union case
			inputReader = new MutableRecordReader<DeserializationDelegate<IT>>(
					getEnvironment().getInputGate(0),
					getEnvironment().getTaskManagerInfo().getTmpDirectories());
		} else if (groupSize > 1){
			// union case
			inputReader = new MutableRecordReader<IOReadableWritable>(
					new UnionInputGate(getEnvironment().getAllInputGates()),
					getEnvironment().getTaskManagerInfo().getTmpDirectories());
		} else {
			throw new Exception("Illegal input group size in task configuration: " + groupSize);
		}
		
		this.inputTypeSerializerFactory = this.config.getInputSerializer(0, getUserCodeClassLoader());
		@SuppressWarnings({ "rawtypes" })
		final MutableObjectIterator<?> iter = new ReaderIterator(inputReader, this.inputTypeSerializerFactory.getSerializer());
		this.reader = (MutableObjectIterator<IT>)iter;

		// final sanity check
		if (numGates != this.config.getNumInputs()) {
			throw new Exception("Illegal configuration: Number of input gates and group sizes are not consistent.");
		}
	}
556855
private String readFile(String fileName) {
        String text;
        try {
            try (Reader r = new FileReader(fileName)) {
                text = Kit.readReader(r);
            }
        } catch (IOException ex) {
            MessageDialogWrapper.showMessageDialog(this,
                                                   ex.getMessage(),
                                                   "Error reading "+fileName,
                                                   JOptionPane.ERROR_MESSAGE);
            text = null;
        }
        return text;
    }
998046
public void ls() throws Exception {

        String folder = CmsResource.getFolderPath(m_cms.getRequestContext().getUri());
        List<CmsResource> resources = m_cms.getResourcesInFolder(folder, CmsResourceFilter.IGNORE_EXPIRATION);
        m_shell.getOut().println(
            "\n" + getMessages().key(Messages.GUI_SHELL_LS_2, folder, new Integer(resources.size())));
        Iterator<CmsResource> i = resources.iterator();
        while (i.hasNext()) {
            CmsResource r = i.next();
            m_shell.getOut().println(m_cms.getSitePath(r));
        }
        m_shell.getOut().println();
    }
9220
public function extract()
    {
        if (!isset($this->config['sourcePath'], $this->config['languages'])) {
            throw new Exception('The configuration must specify "sourcePath" and "languages".');
        }

        foreach ($this->config['sourcePath'] as $sourcePath) {
            if (!is_dir($sourcePath)) {
                throw new Exception("The source path {$sourcePath} is not a valid directory.");
            }
        }

        if (empty($this->config['format']) || !in_array($this->config['format'], ['php', 'po', 'db'])) {
            throw new Exception('Format should be either "php", "po" or "db".');
        }
        if (in_array($this->config['format'], ['php', 'po'])) {
            if (!isset($this->config['messagePath'])) {
                throw new Exception('The configuration file must specify "messagePath".');
            } elseif (!is_dir($this->config['messagePath'])) {
                throw new Exception("The message path {$this->config['messagePath']} is not a valid directory.");
            }
        }
        if (empty($this->config['languages'])) {
            throw new Exception("Languages cannot be empty.");
        }

        $files = [];
        foreach ( $this->config['sourcePath'] as $sourcePath ) {
            $files = array_merge(
                array_values($files),
                array_values(FileHelper::findFiles(realpath($sourcePath), $this->config))
            );
        }

        $messages = [];
        foreach ($files as $file) {
            $messages = array_merge_recursive($messages, $this->extractMessages($file, $this->config['translator']));
        }
        if (in_array($this->config['format'], ['php', 'po'])) {
            foreach ($this->config['languages'] as $language) {
                $dir = $this->config['messagePath'] . DIRECTORY_SEPARATOR . $language;
                if (!is_dir($dir)) {
                    @mkdir($dir);
                }
                if ($this->config['format'] === 'po') {
                    $catalog = isset($this->config['catalog']) ? $this->config['catalog'] : 'messages';
                    return $this->saveMessagesToPO($messages, $dir, $this->config['overwrite'], $this->config['removeUnused'], $this->config['sort'], $catalog);
                } else {
                    return $this->saveMessagesToPHP($messages, $dir, $this->config['overwrite'], $this->config['removeUnused'], $this->config['sort']);
                }
            }
        } elseif ($this->config['format'] === 'db') {
            $db = \Yii::$app->get(isset($this->config['db']) ? $this->config['db'] : 'db');
            if (!$db instanceof \yii\db\Connection) {
                throw new Exception('The "db" option must refer to a valid database application component.');
            }
            $sourceMessageTable = isset($this->config['sourceMessageTable']) ? $this->config['sourceMessageTable'] : '{{%source_message}}';
            $messageTable = isset($this->config['messageTable']) ? $this->config['messageTable'] : '{{%message}}';
            return $this->saveMessagesToDb(
                $messages,
                $db,
                $sourceMessageTable,
                $messageTable,
                $this->config['removeUnused'],
                $this->config['languages']
            );
        }
    }
1340907
@Override
    public int read(char[] cbuf, int off, int len) throws IOException
    {
        if (m_stringReader == null) {
            m_bytes = m_jarFile.get(m_path);
            if (m_bytes == null) {
                // A stubborn caller will get StringReader exceptions.
                m_stringReader = new StringReader("");
                throw new IOException(String.format(
                        "DDL file \"%s\" not found in in-memory jar file.",
                        m_path));
            }
            m_stringReader = new StringReader(new String(m_bytes, "UTF-8"));
        }
        return m_stringReader.read(cbuf, off, len);
    }
421872
public void init() throws Exception {
        userDir = new File(System.getProperty("user.dir")).getAbsolutePath();
        System.setProperty("user.dir", options.getExecutionDirectory().getAbsolutePath());

        if (!cfg.exists()) {

            ConfigurationManager manager = new ConfigurationManager(cfg, false, locateConfigurationProvider());

            try {

                manager.runProjectConfigurationInitializers();

                if (options.isVerbose()) {
                    log.info("CONFIGURATION FILE [" + cfg.getAbsolutePath() + "] CREATION COMPLETE");
                }

            } catch (IOException aux) {
                if (options.isVerbose()) {
                    log.error("The system can't create the file [ " + cfg.getAbsolutePath() + "]");
                }
                if (options.isThrowException()) {
                    System.setProperty("user.dir", userDir);
                    throw aux;
                }
            }

        } else {
            if (options.isVerbose()) {
                log.error("The configuration file [" + cfg.getAbsolutePath() + "] already exists");
            }
        }
        System.setProperty("user.dir", userDir);
    }
284575
public static void main(String[] args) throws Exception {
    if (args[0].equals("-readDoc")) {
      Document doc = readDocumentFromFile(args[1]);
      System.out.println(doc);
    } else {
      String s = IOUtils.slurpFile(args[0]);
      Reader r = new StringReader(s);
      String tag = readTag(r);
      while (tag.length() > 0) {
        readUntilTag(r);
        tag = readTag(r);
        if (tag.length() == 0) {
          break;
        }
        System.out.println("got tag=" + new XMLTag(tag));
      }
    }
  }
1119255
private void readConfigFile() {
    File configFile = new File(CONFIG_FILE_PATH);
    /* config file is not there -> create config file with default */
    if (!configFile.exists()) {
      resetConfigToDefault();
    }

    try {
      PropertiesConfiguration conf = new PropertiesConfiguration(CONFIG_FILE_PATH);
      chemistry = conf.getString(CHEMISTRY_PLUGIN);
    } catch (ConfigurationException e) {
      resetConfigToDefault();
      e.printStackTrace();
    }
  }
420160
@SuppressWarnings("null")
    private void init(CmsObject cms) throws Exception {

        CmsFile configFile = cms.readFile(m_resource);
        CmsXmlContent content = CmsXmlContentFactory.unmarshal(cms, configFile);
        m_title = content.getValue(N_TITLE, CmsConfigurationReader.DEFAULT_LOCALE).getStringValue(cms);
        I_CmsXmlContentValue titleKey = content.getValue(N_TITLE_KEY, CmsConfigurationReader.DEFAULT_LOCALE);
        if ((titleKey != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(titleKey.getStringValue(cms))) {
            m_titleKey = titleKey.getStringValue(cms);
        }
        I_CmsXmlContentValue orderVal = content.getValue(N_ORDER, CmsConfigurationReader.DEFAULT_LOCALE);
        if (orderVal != null) {
            try {
                m_order = Integer.parseInt(orderVal.getStringValue(cms));
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
                m_order = DEFAULT_ORDER;
            }
        } else {
            m_order = DEFAULT_ORDER;
        }

        I_CmsXmlContentValue parentView = content.getValue("Parent", CmsConfigurationReader.DEFAULT_LOCALE);
        if (parentView != null) {
            CmsUUID parentViewId = null;
            try {
                CmsXmlVarLinkValue elementViewValue = (CmsXmlVarLinkValue)parentView;
                String stringValue = elementViewValue.getStringValue(cms);
                if (CmsStringUtil.isEmpty(stringValue)) {
                    parentViewId = CmsUUID.getNullUUID();
                } else if (stringValue.equals(PARENT_NONE)) {
                    parentViewId = null;
                } else if (stringValue.startsWith(CmsConfigurationReader.VIEW_SCHEME)) {
                    parentViewId = new CmsUUID(stringValue.substring(CmsConfigurationReader.VIEW_SCHEME.length()));
                } else {
                    parentViewId = elementViewValue.getLink(cms).getStructureId();
                }
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            m_parentViewId = parentViewId;
        }

    }
1134374
protected function _load()
    {
        $file = new File($this->_file, "r");

        $data = @parse_ini_string($file->read(), true);
        if ($data === false) {
            throw new Exception\ParserErrorException(
                "Error parsing configuration file {$this->_file}"
            );
        }
        $this->_data = $data;
    }
1277630
static function parse_file( $f ){
		$src = file_get_contents( $f, true );
		if( $src === false ){
			throw new Exception("Cannot read file $f");
		}
		return self::parse_string( $src );
	}
29804
private void read() throws IOException {
		// read specifications for standard fields and data directories
		Map<String, String[]> standardSpec = IOUtil.readMap(STANDARD_SPEC);

		// read magic number
		this.magicNumber = readMagicNumber(standardSpec);

		/* load fields */
		loadStandardFields();
		loadWindowsSpecificFields();
		loadDataDirectory();
	}