Class StorageConfig.Builder

java.lang.Object
io.floci.testcontainers.config.StorageConfig.Builder
Enclosing class:
StorageConfig

public static class StorageConfig.Builder extends Object
Builder for StorageConfig.
  • Method Details

    • randomHostPersistentPath

      public StorageConfig.Builder randomHostPersistentPath()
      Generates a temporary directory on the host and uses it as the persistent storage path. The directory is created under the JVM's default temp-file location with the prefix floci- and is bind-mounted into the container at /app/data.
      Returns:
      this builder
      Throws:
      IllegalStateException - if the temporary directory cannot be created
    • pruneVolumesOnDelete

      public StorageConfig.Builder pruneVolumesOnDelete(boolean pruneVolumesOnDelete)
      Sets whether named volumes are removed immediately after a child container stops on resource delete. In memory storage mode volumes are always removed regardless of this flag. Defaults to false to match real AWS behaviour (data survives delete).
      Parameters:
      pruneVolumesOnDelete - true to prune volumes on delete (default true)
      Returns:
      this builder
    • build

      public StorageConfig build()
      Creates an immutable StorageConfig from this builder.
      Returns:
      the storage configuration