Skip to main content

Class XBRApiMetaFileSystem

Provides the primary entry point for accessing the XperiFlow MetaFileSystem through the XBRApi facade.

Namespace: Workspace.XBR.Xperiflow.SubApis

Assembly: Xperiflow.dll

Declaration
public class XBRApiMetaFileSystem

Examples

Example 1: Create a client using MetaFileSystemLocation enum

// Create a Routine-scoped client
var routineClient = XBRApi.MetaFileSystem.GetMetaFileSystemClient(
si,
MetaFileSystemLocation.Routine
);

// Read a Python script (implicit path - no protocol needed)
var scriptContent = routineClient.GetFileContentStringAsync("scripts/processor.py").Result;

// Write execution results
var outputJson = "{\"status\": \"completed\", \"records\": 1500}";
routineClient.WriteFileAsync("output/results.json", outputJson, overwriteOk: true).Wait();

Example 2: Create a client using custom connection key

// Get connection key for Framework location
var connectionKey = XBRApi.MetaFileSystem.GetConnectionKey(si, MetaFileSystemLocation.Framework);

// Create client with connection key
var frameworkClient = XBRApi.MetaFileSystem.GetMetaFileSystemClient(si, connectionKey);

// Access framework configuration
var config = frameworkClient.GetFileContentStringAsync("config/app.json").Result;

Example 3: Create a Meta client for cross-location access

// Create Meta client for unified access to all locations
var metaClient = XBRApi.MetaFileSystem.GetMetaFileSystemClient(
si,
MetaFileSystemLocation.Meta
);

// Access files across multiple locations (explicit protocols required)
var frameworkConfig = metaClient.GetFileContentStringAsync("framework://config/app.json").Result;
var routineScript = metaClient.GetFileContentStringAsync("routine://scripts/process.py").Result;
var sharedData = metaClient.GetFileContentByteArrayAsync("shared://templates/report.xlsx").Result;

// Copy file from Framework to Routine
var seedData = metaClient.GetFileContentByteArrayAsync("framework://seed_data/config.json").Result;
metaClient.WriteFileAsync("routine://config/imported.json", seedData).Wait();

Example 4: Use factory pattern for multiple clients

// Create factory for session
var factory = XBRApi.MetaFileSystem.GetMetaFileSystemClientFactory(si);

// Create multiple clients from factory
var frameworkClient = factory.CreateClient(MetaFileSystemLocation.Framework);
var routineClient = factory.CreateClient(MetaFileSystemLocation.Routine);
var sharedClient = factory.CreateClient(MetaFileSystemLocation.Shared);

// All clients share the same HTTP and storage infrastructure
var config = frameworkClient.GetFileContentStringAsync("config/settings.json").Result;
var script = routineClient.GetFileContentStringAsync("scripts/task.py").Result;
var template = sharedClient.GetFileContentByteArrayAsync("templates/report.xlsx").Result;

Example 5: Directory and metadata operations

var client = XBRApi.MetaFileSystem.GetMetaFileSystemClient(
si,
MetaFileSystemLocation.Routine
);

// Check if directory exists
bool dirExists = client.DirectoryExistsAsync("projects/2024").Result;

if (dirExists)
{
// Get directory metadata
var dirMetadata = client.GetDirectoryMetadataAsync("projects/2024").Result;
BRApi.ErrorLog.LogMessage(si, $"Directory created: {dirMetadata.CreatedTime}");

// List directory contents
var dirContent = client.GetDirectoryAsync("projects/2024", maxDepth: 2).Result;
foreach (var file in dirContent.Files)
{
BRApi.ErrorLog.LogMessage(si, $"File: {file.Name}, Size: {file.Size} bytes");
}
}
else
{
// Create directory if it doesn't exist
client.MakeDirectoriesAsync("projects/2024/Q4", existsOk: true).Wait();
}

Remarks

The Workspace.XBR.Xperiflow.SubApis.XBRApiMetaFileSystem class serves as the main gateway for creating and configuring MetaFileSystem clients within OneStream Business Rules. Following the familiar BRApi pattern from the OneStream platform, this class provides factory methods to instantiate Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient instances that enable file and directory operations across the XperiFlow storage infrastructure.

Access Pattern:

This class is accessed through the static XBRApi.MetaFileSystem property, providing a consistent and discoverable API surface that integrates seamlessly with existing OneStream business rule code.

Storage Locations:

The MetaFileSystem supports multiple logical storage locations, each serving a specific purpose:

  • Framework (framework://) - System-level configuration and framework resources

  • Routine (routine://) - Executable scripts, workflows, and routine artifacts

  • Shared (shared://) - Cross-application data and collaborative resources

  • Meta - Unified access to all locations (requires explicit protocols)

Client Creation Options:

This class provides multiple overloads for creating MetaFileSystem clients to support various scenarios:

For comprehensive documentation on file operations, path resolution, and advanced features, see Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient and Workspace.XBR.Xperiflow.MetaFileSystem.MetaFileSystemClient.

Methods

GetConnectionKey(SessionInfo, MetaFileSystemLocation)

Gets the MetaFileSystem connection key based on the provided Workspace.XBR.Xperiflow.MetaFileSystem.MetaFileSystemLocation.

Declaration
public string GetConnectionKey(SessionInfo si, MetaFileSystemLocation metaFileSystemLocation)
Returns

System.String

A connection key that can be used to instantiate an Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient.

Parameters
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe SessionInfo object
Workspace.XBR.Xperiflow.MetaFileSystem.MetaFileSystemLocationmetaFileSystemLocationAn Workspace.XBR.Xperiflow.MetaFileSystem.MetaFileSystemLocation representing the MetaFileSystem connection key

GetMetaFileSystemClient(SessionInfo, string, OISToken)

Instantiates a Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient based on the provided connection key.

Declaration
public IMetaFileSystemClient GetMetaFileSystemClient(SessionInfo si, string connectionKey, OISToken oisToken = null)
Returns

Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient

An Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient that can be used to interact with files and directories in the MetaFileSystem

Parameters
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe SessionInfo object
System.StringconnectionKeyThe MetaFileSystem connection key
OneStream.Shared.Wcf.OISTokenoisTokenOptional OIS authentication token for explicit interaction with Xperiflow REST API. If null, automatically instantiates one internally. Note: You may want to provide an explicit token due to OneStream platform limitations on which Platform servers are allowed to interact with OIS

GetMetaFileSystemClient(SessionInfo, string, IHttpClientManager, IXperiflowStorageClient)

Instantiates a Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient based on the provided connection key, Workspace.XBR.Xperiflow.Utilities.Http.IHttpClientManager, and Workspace.XBR.Xperiflow.Core.RestApi.Storage.IXperiflowStorageClient.

Declaration
public IMetaFileSystemClient GetMetaFileSystemClient(SessionInfo si, string connectionKey, IHttpClientManager httpClientManager, IXperiflowStorageClient xperiflowStorageClient)
Returns

Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient

An Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient that can be used to interact with files and directories in the MetaFileSystem

Parameters
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe SessionInfo object
System.StringconnectionKeyThe MetaFileSystem connection key
Workspace.XBR.Xperiflow.Utilities.Http.IHttpClientManagerhttpClientManagerAn IHTTPClientManager
Workspace.XBR.Xperiflow.Core.RestApi.Storage.IXperiflowStorageClientxperiflowStorageClientAn IXperiflowStorageClient

GetMetaFileSystemClient(SessionInfo, MetaFileSystemLocation, OISToken)

Instantiates a Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient based on a Workspace.XBR.Xperiflow.MetaFileSystem.MetaFileSystemLocation.

Declaration
public IMetaFileSystemClient GetMetaFileSystemClient(SessionInfo si, MetaFileSystemLocation metaFileSystemLocation, OISToken oisToken = null)
Returns

Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient

An Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemClient that can be used to interact with files and directories in the MetaFileSystem

Parameters
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe SessionInfo object
Workspace.XBR.Xperiflow.MetaFileSystem.MetaFileSystemLocationmetaFileSystemLocationAn Workspace.XBR.Xperiflow.MetaFileSystem.MetaFileSystemLocation representing the MetaFileSystem connection key
OneStream.Shared.Wcf.OISTokenoisTokenOptional OIS authentication token for explicit interaction with Xperiflow REST API. If null, automatically instantiates one internally. Note: You may want to provide an explicit token due to OneStream platform limitations on which Platform servers are allowed to interact with OIS

GetMetaFileSystemClientFactory(SessionInfo, IXperiflowStorageClient, OISToken)

Instantiates a Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemSessionClientFactory to create instances of the MetaFileSystemClient. The primary purpose of this factory is to inject the HttpClientManager and XperiflowClient into the MetaFileSystemClient and simplify the creation of the MetaFileSystemClient for developers.

Declaration
public IMetaFileSystemSessionClientFactory GetMetaFileSystemClientFactory(SessionInfo si, IXperiflowStorageClient xperiflowStorageClient = null, OISToken oisToken = null)
Returns

Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemSessionClientFactory

An Workspace.XBR.Xperiflow.MetaFileSystem.IMetaFileSystemSessionClientFactory that can be used to create instances of the MetaFileSystem Client

Parameters
TypeNameDescription
OneStream.Shared.Common.SessionInfosiThe SessionInfo object
Workspace.XBR.Xperiflow.Core.RestApi.Storage.IXperiflowStorageClientxperiflowStorageClient
OneStream.Shared.Wcf.OISTokenoisTokenOptional OIS authentication token for explicit interaction with Xperiflow REST API. If null, automatically instantiates one internally. Note: You may want to provide an explicit token due to OneStream platform limitations on which Platform servers are allowed to interact with OIS

Inherited Members

  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object,System.Object)
  • System.Object.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.ToString

Was this page helpful?