code: protected Reader createTempResource(GeneratorContext context, CacheMode cacheMode, Reader rd) {
  		String filePath = getTempFilePath(context, cacheMode);
  		Writer wr = null;
  		FileOutputStream fos = null;
  		try {
  			File f = new File(filePath);
  			if (!f.getParentFile().exists()) {
  				f.getParentFile().mkdirs();
  			}
  			String content = IOUtils.toString(rd);
  			fos = new FileOutputStream(f);
  			FileChannel channel = fos.getChannel();
  			wr = Channels.newWriter(channel, config.getResourceCharset().newEncoder(), -1);
  			wr.write(content);
  
  			rd = new StringReader(content);
  		} catch (IOException e) {
  			throw new BundlingProcessException("Unable to create temporary resource for '" + context.getPath() + "'",
  					e);
  		} finally {
  			IOUtils.close(wr);
  			IOUtils.close(fos);
  		}
  
  		return rd;
  	}
docs: Creates the temporary resource
  
  @param context
  the context
  @param cacheMode
  the cache mode
  @param rd
  the reader of the compiled resource
  @return the reader