code: @POST
      public Response runRestore(final InputStream bodyStream) throws IOException {
  
          if (null == bodyStream) {
              throw new WebApplicationException(serverError().entity(
                      "Request body must not be null").build());
          }
  
          final String body = IOUtils.toString(bodyStream);
          final File backupDirectory = new File(body.trim());
          if (!backupDirectory.exists()) {
              throw new WebApplicationException(serverError().entity(
                      "Backup directory does not exist: "
                              + backupDirectory.getAbsolutePath()).build());
          }
  
          final Collection<Throwable> problems = repositoryService.restoreRepository(session.getFedoraSession(),
                  backupDirectory);
          if (!problems.isEmpty()) {
              LOGGER.error("Problems restoring up the repository:");
  
              // Report the problems (we'll just print them out) ...
              final String problemsOutput = problems.stream().map(Throwable::getMessage).peek(LOGGER::error)
                      .collect(joining("\n"));
  
              throw new WebApplicationException(serverError()
                      .entity(problemsOutput).build());
  
          }
          return noContent()
              .header("Warning", "This endpoint will be moving to an extension module in a future release of Fedora")
              .build();
  
      }
docs: This method runs a repository restore.
  
  @param bodyStream the body stream
  @return response
  @throws IOException if IO exception occurred