Skip to main content

FileHelper

The FileHelper offers functionality to work with files.

import { FileHelper } from '@archibald/server';

setRoot

This method sets file root.

import { FileHelper } from '@archibald/server';

FileHelper.setRoot(PARAMETERS);

Parameters

NameTypeDescriptionDefault
pathstringA file path...

getRoot

This method returns file root directory for a given type.

import { FileHelper } from '@archibald/server';

const root = FileHelper.getRoot(PARAMETERS);

Parameters

NameTypeDescriptionDefault
typeDirectoryTypeA directory type.client

loadFile

This method loads a file or the content of a file.

import { FileHelper } from '@archibald/server';

const file = FileHelper.loadFile(PARAMETERS);

Parameters

NameTypeOptionalDescription
pathstringThe path to a file.
contentboolean✔️Defines if the content of a file should retrieved.

getConfiguredPath

This method returns configuration path.

import { FileHelper } from '@archibald/server';

const configuredPath = await FileHelper.getConfiguredPath(PARAMETERS);

Parameters

NameTypeOptionalDescription
sourcestringThe source of the configuration.
platformstringThe name of the platform.
tenantstring✔️The name of the tenant.
fallbackstring✔️The name of the fallback platform.