code: @Override public ProjectFile read(InputStream stream) throws MPXJException
     {
        try
        {
           m_projectFile = new ProjectFile();
           m_eventManager = m_projectFile.getEventManager();
           m_calendarMap = new HashMap<Integer, ProjectCalendar>();
           m_taskIdMap = new HashMap<Integer, Task>();
  
           ProjectConfig config = m_projectFile.getProjectConfig();
           config.setAutoResourceUniqueID(false);
           config.setAutoResourceID(false);
  
           m_projectFile.getProjectProperties().setFileApplication("ConceptDraw PROJECT");
           m_projectFile.getProjectProperties().setFileType("CDP");
  
           m_eventManager.addProjectListeners(m_projectListeners);
  
           SAXParserFactory factory = SAXParserFactory.newInstance();
           SAXParser saxParser = factory.newSAXParser();
           XMLReader xmlReader = saxParser.getXMLReader();
  
           if (CONTEXT == null)
           {
              throw CONTEXT_EXCEPTION;
           }
  
           Unmarshaller unmarshaller = CONTEXT.createUnmarshaller();
  
           XMLFilter filter = new NamespaceFilter();
           filter.setParent(xmlReader);
           UnmarshallerHandler unmarshallerHandler = unmarshaller.getUnmarshallerHandler();
           filter.setContentHandler(unmarshallerHandler);
           filter.parse(new InputSource(new InputStreamReader(stream)));
           Document cdp = (Document) unmarshallerHandler.getResult();
  
           readProjectProperties(cdp);
           readCalendars(cdp);
           readResources(cdp);
           readTasks(cdp);
           readRelationships(cdp);
  
           //
           // Ensure that the unique ID counters are correct
           //
           config.updateUniqueCounters();
  
           return m_projectFile;
        }
  
        catch (ParserConfigurationException ex)
        {
           throw new MPXJException("Failed to parse file", ex);
        }
  
        catch (JAXBException ex)
        {
           throw new MPXJException("Failed to parse file", ex);
        }
  
        catch (SAXException ex)
        {
           throw new MPXJException("Failed to parse file", ex);
        }
  
        catch (IOException ex)
        {
           throw new MPXJException("Failed to parse file", ex);
        }
  
        finally
        {
           m_projectFile = null;
           m_eventManager = null;
           m_projectListeners = null;
           m_calendarMap = null;
           m_taskIdMap = null;
        }
     }
docs: {@inheritDoc}