/** * * @param SimpleXmlElement $xml */ protected function saveMountpointsFile(SimpleXmlElement $xml) { try { if (!is_file($this->filePath)) { throw new EyeFileNotFoundException($this->filePath); } $xmlWriter = new XmlStreamWriter(new FileOutputStream($this->filePath), array(XmlStreamWriter::PARAM_FORMATOUTPUT => true)); $xmlWriter->write($xml); $xmlWriter->close(); } catch (Exception $e) { throw new EyeIOException('Unable to save mountpoints configuration at ' . $this->filePath . '.', 0, $e); } }