Table of Contents

Class Sandbox

Namespace
Steeltoe.Common.Utils.IO
Assembly
Steeltoe.Common.Utils.dll

A temporary directory that can be used as a sandbox. Files and directories created in the sandbox are deleted when the sandbox is disposed.

[Obsolete("This feature will be removed in the next major version. See https://steeltoe.io/docs/v3/obsolete for details.")]
public class Sandbox : TempDirectory, IDisposable
Inheritance
Sandbox
Implements
Inherited Members

Constructors

Sandbox(string)

A temporary directory.

public Sandbox(string name = "Sandbox-")

Parameters

name string

Sandbox prefix, defaults to DefaultPrefix.

Fields

DefaultPrefix

The default sandbox prefix ("Sandbox-").

public const string DefaultPrefix = "Sandbox-"

Field Value

string

Methods

CreateDirectory(string)

Creates a sandbox directory at the specified path.

public string CreateDirectory(string path)

Parameters

path string

Directory path.

Returns

string

Full path name of created directory.

CreateFile(string, string)

Creates a sandbox file at the specified path.

public string CreateFile(string path, string text = "")

Parameters

path string

File path.

text string

Text to write to file.

Returns

string

Full path name of created file.

ResolvePath(string)

Resolves the specified path with the sandbox's path.

public string ResolvePath(string path)

Parameters

path string

Path to resolve.

Returns

string

Resolved path.