code: public void copyResource(DocPath resource, boolean overwrite, boolean replaceNewLine)
                  throws DocFileIOException, ResourceIOException {
          if (exists() && !overwrite)
              return;
  
          try {
              InputStream in = Configuration.class.getResourceAsStream(resource.getPath());
              if (in == null)
                  return;
  
              try {
                  if (replaceNewLine) {
                      try (BufferedReader reader = new BufferedReader(new InputStreamReader(in))) {
                          try (Writer writer = openWriter()) {
                              String line;
                              while ((line = readResourceLine(resource, reader)) != null) {
                                  write(this, writer, line);
                                  write(this, writer, DocletConstants.NL);
                              }
                          } catch (IOException e) {
                              throw new DocFileIOException(this, DocFileIOException.Mode.WRITE, e);
                          }
                      }
                  } else {
                      try (OutputStream out = openOutputStream()) {
                          byte[] buf = new byte[2048];
                          int n;
                          while ((n = readResource(resource, in, buf)) > 0) {
                              write(this, out, buf, n);
                          }
                      } catch (IOException e) {
                          throw new DocFileIOException(this, DocFileIOException.Mode.WRITE, e);
                      }
                  }
              } finally {
                  in.close();
              }
          } catch (IOException e) {
              throw new ResourceIOException(resource, e);
          }
      }
docs: Copy the contents of a resource file to this file.
  
  @param resource the path of the resource, relative to the package of this class
  @param overwrite whether or not to overwrite the file if it already exists
  @param replaceNewLine if false, the file is copied as a binary file;
  if true, the file is written line by line, using the platform line
  separator
  
  @throws DocFileIOException if there is a problem while writing the copy
  @throws ResourceIOException if there is a problem while reading the resource