code: private List<ValidationPlanResult> validateFile(File file, Writer writer) throws IOException
  	{
  
  		List<ValidationPlanResult> messages = new ArrayList<ValidationPlanResult>();
  		ArrayList<Object> entryList = new ArrayList<Object>();
  		BufferedReader fileReader = null; 
  
  		try
  		{
  			fileReader= new BufferedReader(new FileReader(file));
  			prepareReader(	fileReader,file.getName());
  			List<ValidationPlanResult> results = validateEntriesInReader(writer,file,entryList);
  			ValidationPlanResult entrySetResult = validateEntry(entryList);
  			if (file != null)
  			{
  				entrySetResult.setTargetOrigin(file.getName());
  			}
  			for (ValidationPlanResult planResult : results)
  			{
  				messages.add(planResult);
  			}
  			if (!entrySetResult.isValid())
  			{
  				writeResultsToFile(entrySetResult);
  				messages.add(entrySetResult);
  			}
  
  		}
  		catch (Exception e)
  		{
  			e.printStackTrace();
  		}
  		finally{
  			if(fileReader!=null)
  			fileReader.close();
  		}
  
  		return messages;
  	}
docs: Validate file.
  
  @param file
  the file
  @param writer
  the writer
  @return the list of ValidationPlanResult
  @throws IOException
  @throws ValidationEngineException