code: protected void createBundleFile(HttpServlet servlet,
  			MockServletResponse response, MockServletRequest request,
  			String path, File destFile, String mapping) throws IOException,
  			ServletException {
  
  		request.setRequestPath(mapping, path);
  
  		// Create the parent directory of the destination file
  		if (!destFile.getParentFile().exists()) {
  			boolean dirsCreated = destFile.getParentFile().mkdirs();
  			if (!dirsCreated) {
  				throw new IOException("The directory '"
  						+ destFile.getParentFile().getCanonicalPath()
  						+ "' can't be created.");
  			}
  		}
  
  		// Set the response mock to write in the destination file
  		try {
  			response.setOutputStream(new FileOutputStream(destFile));
  			servlet.service(request, response);
  		} finally {
  			response.close();
  		}
  
  		if (destFile.length() == 0) {
  			logger.warn("No content retrieved for file '"
  					+ destFile.getAbsolutePath()
  					+ "', which is associated to the path : " + path);
  			System.out.println("No content retrieved for file '"
  					+ destFile.getAbsolutePath()
  					+ "', which is associated to the path : " + path);
  		}
  	}
docs: Create the bundle file
  
  @param servlet
  the servlet
  @param response
  the response
  @param request
  the request
  @param path
  the path
  @param destFile
  the destination file
  @param mapping
  the mapping
  @throws IOException
  if an IO exception occurs
  @throws ServletException
  if an exception occurs