docs: private synchronized boolean cloneEntryToOverlay(ArtifactEntry e, String path, Boolean addAsRoot) throws IOException {
  
          //validate the ArtifactEntry..
          InputStream i = null;
          ArtifactContainer c = null;
          try {
              i = e.getInputStream();
              c = e.convertToContainer();
              if (i == null && c == null) {
                  return false; //reject nonsense entries with no data & no ArtifactContainer.
              }
              if (i == null && c != null) {
                  boolean root = addAsRoot != null ? addAsRoot.booleanValue() : c.isRoot();
                  if (root)
                      return false; //reject ArtifactContainers with no data that wish to be a new root.
              }
  
              if (i != null) {
                  File f = new File(overlayDirectory, path);
                  //make a dir to put it in if there isnt one yet..
                  File parent = f.getParentFile();
                  if (!FileUtils.fileExists(parent)) {
                      //might not be able to add this, if there's a file already clashing where we need a dir.
                      if (!FileUtils.fileMkDirs(parent))
                          return false;
                  }
  
                  FileOutputStream fos = null;
                  try {
                      //set false to overwrite if its already there..
                      fos = Utils.getOutputStream(f, false);
  
                      //wrap it up in an attempt to ensure it's got some buffering.
                      i = new BufferedInputStream(i);
  
                      //rip out the data & spew it to the file.
                      byte buf[] = new byte[1024];
                      int len;
                      while ((len = i.read(buf)) > 0) {
                          fos.write(buf, 0, len);
                      }
                      fos.close();
  
                  } finally {
                      if (fos != null) {
                          fos.close();
                      }
                  }
  
              } else {
                  //can't obtain inputstream.. is this convertible ??
                  if (c != null) {
                      for (ArtifactEntry nested : c) {
                          //we don't use the boolean root, as the override only applies for the 1st conversion.
                          //where it prevents us adding c.isRoot when we are told not to care.
                          cloneEntryToOverlay(nested, path + "/" + nested.getName(), c.isRoot());
                      }
                  }
              }
          } finally {
              if (i != null) {
                  try {
                      i.close();
                  } catch (IOException e1) {
                  }
              }
          }
          return true;
      }