Nucleus .Net Core CMS

Models.Configuration.FolderOptions Class

Namespace: Nucleus.Abstractions.Models.Configuration
Assembly: Nucleus.Abstractions.dll
Represents application folders.
Gets the default application data storage folder location, used for logs and database files.
Array of allowed static file paths
Sub folder name (in the web root folder) used for areas
Sub folder name (within the Nucleus data folder) used for cache files
Sub folder name (in the web root folder) used for shared containers
Sub folder name (within the Nucleus temp folder) used for extensions that should be automatically installed
Sub folder name (in the web root folder) used for extensions
Sub folder name (in the web root folder) used for shared layouts
Sub folder name (within the Nucleus data folder) used for log files
Sub folder name (in the web root folder) used for shared resources (css, js and third-party libraries)
Configuration file section.
Sub folder name (in the web root folder) used for shared files
Sub folder name (within the Nucleus data folder) used for temp files
EnsureExists (String path)
Check whether the specified folder exists, and create it if it does not.
Parameters
Name Type
path String
EnsureExistsStatic (String path)
Check whether the specified folder exists, and create it if it does not.
Parameters
Name Type
path String
GetAutoInstallExtensionsFolder ()
Gets the folder which contains extension packages which are to be automatically installed.
GetCacheFolder ()
Gets the data storage folder location for cache files.
Remarks
If the folder does not exist, it is created.
GetCacheFolder (Boolean create)
Gets the data storage folder location for cache files.
Parameters
Name Type
create Boolean

Specifies whether to check that the folder exists and create it if not.

GetCacheFolder (System.String)
Gets the data storage folder location for cache files and appends the specified sub-folder.
Remarks
If the folder does not exist, it is created.
GetCacheFolder (String subFolder, Boolean create)
Gets the data storage folder location for cache files and appends the specified sub-folder.
Parameters
Name Type
subFolder String

Specifies a sub-folder of the cache folder.

create Boolean

Specifies whether to check that the folder exists and create it if not.

GetDataFolder ()
Gets the root data storage folder location.
GetDataFolder (String subFolder, Boolean create)
Gets an application data storage folder sub-folder.
Parameters
Name Type
subFolder String
create Boolean

Specifies whether to check that the folder exists and create it if not.

Remarks
If the folder does not exist, it is created.
GetExtensionFolder (String name, Boolean create)
Gets a sub-folder of the extensions folder.
Parameters
Name Type
name String

The name of your extension folder, relative to the extensions folder root.

create Boolean

Specifies whether to create the folder if it does not already exist.

GetExtensionFolderStatic (String name, Boolean create)
Gets a sub-folder of the extensions folder.
Parameters
Name Type
name String

The name of your extension folder, relative to the extensions folder root.

create Boolean

Specifies whether to create the folder if it does not already exist.

GetExtensionsFolder ()
Gets the full path to the extensions folder.
GetExtensionsFolder (Boolean create)
Gets the full path to the extensions folder.
Parameters
Name Type
create Boolean

Specifies whether to create the folder if it does not already exist.

GetExtensionsFolderStatic (System.Boolean)
Gets the full path to the extensions folder.
GetLogFolder ()
Gets the data storage folder location for log files.
Remarks
If the folder does not exist, it is created.
GetLogFolder (System.Boolean)
Gets the data storage folder location for log files.
GetLogFolder (String subFolder)
Gets the data storage folder location for log files.
Parameters
Name Type
subFolder String
Remarks
If the folder does not exist, it is created.
GetLogFolder (System.String,  System.Boolean)
Gets the data storage folder location for log files.
GetTempFolder ()
Gets the data storage folder location for temporary files.
Remarks
If the folder does not exist, it is created.
GetTempFolder (Boolean create)
Gets the data storage folder location for temporary files.
Parameters
Name Type
create Boolean

Specifies whether to check that the folder exists and create it if not.

GetWebRootFolder ()
Gets the application root folder.
NormalizePath (String path)
Return the specified path with path separator "\" characters replaced by "/" so that the path will work in both Windows and Linux.
Parameters
Name Type
path String
Parse (String value)
Replaces tokens from any configuration file value.
Parameters
Name Type
value String
ParseFolder (String folderName)
Replaces tokens from configuration entries representing a file name, and returns an absolute path.
Parameters
Name Type
folderName String
SetDataFolder (String value, Boolean ensureExists)
Sets the data folder to the specified value.
Parameters
Name Type
value String

Data folder path

ensureExists Boolean

Specifies whether to ensure that the path exists by creating the folder if it does not already exist.

Remarks
This function is intended for use in a workaround to facilitate startup logging, and should not be called by anything except LoggingBuilderExtensions.ConfigureTextFileLogger.
SetDefaultDataFolder (Boolean ensureExists)
Sets the data folder to a default value if its current value is empty.
Parameters
Name Type
ensureExists Boolean

Specifies whether to ensure that the path exists by creating the folder if it does not already exist.