Class UnbundleCommandBuilder

java.lang.Object
sonia.scm.repository.api.UnbundleCommandBuilder

public final class UnbundleCommandBuilder extends Object
The unbundle command can restore an empty repository from a bundle. The bundle can be created with the BundleCommandBuilder.
Since:
1.43
  • Constructor Details

  • Method Details

    • unbundle

      public UnbundleResponse unbundle(File inputFile) throws IOException
      Restores the repository from the given bundle.
      Parameters:
      inputFile - input file
      Returns:
      unbundle response
      Throws:
      IOException
    • unbundle

      public UnbundleResponse unbundle(InputStream inputStream) throws IOException
      Restores the repository from the given bundle.
      Parameters:
      inputStream - input stream
      Returns:
      unbundle response
      Throws:
      IOException
    • unbundle

      public UnbundleResponse unbundle(com.google.common.io.ByteSource byteSource) throws IOException
      Restores the repository from the given bundle.
      Parameters:
      byteSource - byte source
      Returns:
      unbundle response
      Throws:
      IOException
    • setCompressed

      public UnbundleCommandBuilder setCompressed(boolean compressed)
      Set to true if bundle is gzip compressed. Default is false.
      Parameters:
      compressed - true if bundle is gzip compressed
      Returns:
      this
    • setPostEventSink

      public UnbundleCommandBuilder setPostEventSink(Consumer<RepositoryHookEvent> postEventSink)
      Sets a event sink to receive a RepositoryHookEvent on successful unbundle. The default implementation wraps the event and sends it to the event bus.
      Parameters:
      postEventSink - consumer to process the event
      Returns:
      this
      Since:
      2.14.0