Class Sandbox
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
namestringSandbox prefix, defaults to DefaultPrefix.
Fields
DefaultPrefix
The default sandbox prefix ("Sandbox-").
public const string DefaultPrefix = "Sandbox-"
Field Value
Methods
CreateDirectory(string)
Creates a sandbox directory at the specified path.
public string CreateDirectory(string path)
Parameters
pathstringDirectory 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
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
pathstringPath to resolve.
Returns
- string
Resolved path.