code: protected void writeResource(final String packageName, final String resourceName, final StringBuffer content) {
          try {
              FileObject mf = filer.createResource(StandardLocation.SOURCE_OUTPUT, packageName, resourceName);
              Writer w = mf.openWriter();
              BufferedWriter bw = new BufferedWriter(w);
              bw.append(content);
              bw.close();
              w.close();
          } catch (IOException e) {
              throw new GenerationException(String.format("Error writing content for %s.%s: %s",
                      packageName, resourceName, e.getMessage()));
          }
      }
docs: Writes the specified resource and wraps any {@code IOException} as {@link GenerationException}.
  
  @param packageName  the package name
  @param resourceName the resource name
  @param content      the content
  @throws GenerationException if an {@code IOException occurs}