code: private boolean copy(InputStream source, String destination) {
          boolean success = true;
  
          try
          {
              Files.copy(source, Paths.get(destination), StandardCopyOption.REPLACE_EXISTING);
          } catch (IOException ex)
          {
              LOG.fatal("Cannot write file " + destination, ex);
              success = false;
          }
  
          return success;
      }
docs: Copy a file from source to destination.
  
  @param source The name of the bundled file.
  @param destination the destination
  @return True if succeeded , False if not