private ProjectFile readFile ( String inputFile ) throws MPXJException { ProjectReader reader = new UniversalProjectReader ( ) ; ProjectFile projectFile = reader . read ( inputFile ) ; if ( projectFile == null ) { throw new IllegalArgumentException ( "Unsupported file type" ) ; } return projectFile ; }
Use the universal project reader to open the file . Throw an exception if we can t determine the file type .