code: private void check( File file, String encoding, XmlFormatViolationHandler violationHandler )
          throws MojoExecutionException
      {
  
          Reader in = null;
          try
          {
              in = new InputStreamReader( new FileInputStream( file ), encoding );
              SAXParser saxParser = saxParserFactory.newSAXParser();
              IndentCheckSaxHandler handler = new IndentCheckSaxHandler( file, indentSize, violationHandler );
              saxParser.parse( new InputSource( in ), handler );
          }
          catch ( Exception e )
          {
              throw new MojoExecutionException( "Could not process file " + file.getAbsolutePath(), e );
          }
          finally
          {
              if ( in != null )
              {
                  try
                  {
                      in.close();
                  }
                  catch ( IOException e )
                  {
                      getLog().error( "Could not close Reader for " + file.getAbsolutePath(), e );
                  }
              }
          }
      }
docs: Checks the formatting of the given {@code file}. The file is read using the given {@code encoding} and the
  violations are reported to the given {@code violationHandler}.
  
  @param file the file to check
  @param encoding the encoding to use for reading the {@code file}
  @param violationHandler the {@link XmlFormatViolationHandler} to report violations
  @throws MojoExecutionException if there is any lover level exception reading or parsing the file.