Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IFileService

    Defines the File Service, which is an easy access to operations involving IFile objects like Scripts, Stylesheets and Templates

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IFileService : IService

    Methods

    View Source

    CreatePartialView(IPartialView, string?, int?)

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    Attempt<IPartialView?> CreatePartialView(IPartialView partialView, string? snippetName = null, int? userId = -1)
    Parameters
    Type Name Description
    IPartialView partialView
    string snippetName
    int? userId
    Returns
    Type Description
    Attempt<IPartialView>
    View Source

    CreatePartialViewFolder(string)

    Declaration
    [Obsolete("Please use IPartialViewFolderService for partial view folder operations - will be removed in Umbraco 15")]
    void CreatePartialViewFolder(string folderPath)
    Parameters
    Type Name Description
    string folderPath
    View Source

    CreateScriptFolder(string)

    Creates a folder for scripts

    Declaration
    [Obsolete("Please use IScriptFolderService for script folder operations - will be removed in Umbraco 15")]
    void CreateScriptFolder(string folderPath)
    Parameters
    Type Name Description
    string folderPath
    View Source

    CreateStyleSheetFolder(string)

    Creates a folder for style sheets

    Declaration
    [Obsolete("Please use IStylesheetFolderService for stylesheet folder operations - will be removed in Umbraco 15")]
    void CreateStyleSheetFolder(string folderPath)
    Parameters
    Type Name Description
    string folderPath
    View Source

    CreateTemplateForContentType(string, string?, int)

    Creates a template for a content type

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    Attempt<OperationResult<OperationResultType, ITemplate>?> CreateTemplateForContentType(string contentTypeAlias, string? contentTypeName, int userId = -1)
    Parameters
    Type Name Description
    string contentTypeAlias
    string contentTypeName
    int userId
    Returns
    Type Description
    Attempt<OperationResult<OperationResultType, ITemplate>>

    The template created

    View Source

    CreateTemplateWithIdentity(string?, string?, string?, ITemplate?, int)

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    ITemplate CreateTemplateWithIdentity(string? name, string? alias, string? content, ITemplate? masterTemplate = null, int userId = -1)
    Parameters
    Type Name Description
    string name
    string alias
    string content
    ITemplate masterTemplate
    int userId
    Returns
    Type Description
    ITemplate
    View Source

    DeletePartialView(string, int?)

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    bool DeletePartialView(string path, int? userId = null)
    Parameters
    Type Name Description
    string path
    int? userId
    Returns
    Type Description
    bool
    View Source

    DeletePartialViewFolder(string)

    Declaration
    [Obsolete("Please use IPartialViewFolderService for partial view folder operations - will be removed in Umbraco 15")]
    void DeletePartialViewFolder(string folderPath)
    Parameters
    Type Name Description
    string folderPath
    View Source

    DeleteScript(string, int?)

    Deletes a script by its name

    Declaration
    [Obsolete("Please use IScriptService for script operations - will be removed in Umbraco 15")]
    void DeleteScript(string path, int? userId = null)
    Parameters
    Type Name Description
    string path

    Name incl. extension of the Script to delete

    int? userId

    Optional id of the user deleting the script

    View Source

    DeleteScriptFolder(string)

    Deletes a folder for scripts

    Declaration
    [Obsolete("Please use IScriptFolderService for script folder operations - will be removed in Umbraco 15")]
    void DeleteScriptFolder(string folderPath)
    Parameters
    Type Name Description
    string folderPath
    View Source

    DeleteStyleSheetFolder(string)

    Deletes a folder for style sheets

    Declaration
    [Obsolete("Please use IStylesheetFolderService for stylesheet folder operations - will be removed in Umbraco 15")]
    void DeleteStyleSheetFolder(string folderPath)
    Parameters
    Type Name Description
    string folderPath
    View Source

    DeleteStylesheet(string, int?)

    Deletes a stylesheet by its name

    Declaration
    [Obsolete("Please use IStylesheetService for stylesheet operations - will be removed in Umbraco 15")]
    void DeleteStylesheet(string path, int? userId = null)
    Parameters
    Type Name Description
    string path

    Name incl. extension of the Stylesheet to delete

    int? userId

    Optional id of the user deleting the stylesheet

    View Source

    DeleteTemplate(string, int)

    Deletes a template by its alias

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    void DeleteTemplate(string alias, int userId = -1)
    Parameters
    Type Name Description
    string alias

    Alias of the ITemplate to delete

    int userId

    Optional id of the user deleting the template

    View Source

    GetPartialView(string)

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    IPartialView? GetPartialView(string path)
    Parameters
    Type Name Description
    string path
    Returns
    Type Description
    IPartialView
    View Source

    GetPartialViewFileContentStream(string)

    Gets the content of a partial view as a stream.

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    Stream GetPartialViewFileContentStream(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the partial view.

    Returns
    Type Description
    Stream

    The content of the partial view.

    View Source

    GetPartialViewFileSize(string)

    Gets the size of a partial view.

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    long GetPartialViewFileSize(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the partial view.

    Returns
    Type Description
    long

    The size of the partial view.

    View Source

    GetPartialViews(params string[])

    Gets a list of all IPartialView objects

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    IEnumerable<IPartialView> GetPartialViews(params string[] names)
    Parameters
    Type Name Description
    string[] names
    Returns
    Type Description
    IEnumerable<IPartialView>

    An enumerable list of IPartialView objects

    View Source

    GetScript(string?)

    Gets a IScript object by its name

    Declaration
    [Obsolete("Please use IScriptService for script operations - will be removed in Umbraco 15")]
    IScript? GetScript(string? name)
    Parameters
    Type Name Description
    string name

    Name of the script incl. extension

    Returns
    Type Description
    IScript

    A IScript object

    View Source

    GetScriptFileContentStream(string)

    Gets the content of a script file as a stream.

    Declaration
    [Obsolete("Please use IScriptService for script operations - will be removed in Umbraco 15")]
    Stream GetScriptFileContentStream(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the script.

    Returns
    Type Description
    Stream

    The content of the script file.

    View Source

    GetScriptFileSize(string)

    Gets the size of a script file.

    Declaration
    [Obsolete("Please use IScriptService for script operations - will be removed in Umbraco 15")]
    long GetScriptFileSize(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the script file.

    Returns
    Type Description
    long

    The size of the script file.

    View Source

    GetScripts(params string[])

    Gets a list of all IScript objects

    Declaration
    [Obsolete("Please use IScriptService for script operations - will be removed in Umbraco 15")]
    IEnumerable<IScript> GetScripts(params string[] names)
    Parameters
    Type Name Description
    string[] names
    Returns
    Type Description
    IEnumerable<IScript>

    An enumerable list of IScript objects

    View Source

    GetStylesheet(string?)

    Gets a IStylesheet object by its name

    Declaration
    [Obsolete("Please use IStylesheetService for stylesheet operations - will be removed in Umbraco 15")]
    IStylesheet? GetStylesheet(string? path)
    Parameters
    Type Name Description
    string path

    Path of the stylesheet incl. extension

    Returns
    Type Description
    IStylesheet

    A IStylesheet object

    View Source

    GetStylesheetFileContentStream(string)

    Gets the content of a stylesheet as a stream.

    Declaration
    [Obsolete("Please use IStylesheetService for stylesheet operations - will be removed in Umbraco 15")]
    Stream GetStylesheetFileContentStream(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the stylesheet.

    Returns
    Type Description
    Stream

    The content of the stylesheet.

    View Source

    GetStylesheetFileSize(string)

    Gets the size of a stylesheet.

    Declaration
    [Obsolete("Please use IStylesheetService for stylesheet operations - will be removed in Umbraco 15")]
    long GetStylesheetFileSize(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the stylesheet.

    Returns
    Type Description
    long

    The size of the stylesheet.

    View Source

    GetStylesheets(params string[])

    Gets a list of all IStylesheet objects

    Declaration
    [Obsolete("Please use IStylesheetService for stylesheet operations - will be removed in Umbraco 15")]
    IEnumerable<IStylesheet> GetStylesheets(params string[] paths)
    Parameters
    Type Name Description
    string[] paths
    Returns
    Type Description
    IEnumerable<IStylesheet>

    An enumerable list of IStylesheet objects

    View Source

    GetTemplate(Guid)

    Gets a ITemplate object by its guid identifier.

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    ITemplate? GetTemplate(Guid id)
    Parameters
    Type Name Description
    Guid id

    The guid identifier of the template.

    Returns
    Type Description
    ITemplate

    The ITemplate object matching the identifier, or null.

    View Source

    GetTemplate(int)

    Gets a ITemplate object by its identifier.

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    ITemplate? GetTemplate(int id)
    Parameters
    Type Name Description
    int id

    The identifier of the template.

    Returns
    Type Description
    ITemplate

    The ITemplate object matching the identifier, or null.

    View Source

    GetTemplate(string?)

    Gets a ITemplate object by its alias.

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    ITemplate? GetTemplate(string? alias)
    Parameters
    Type Name Description
    string alias

    The alias of the template.

    Returns
    Type Description
    ITemplate

    The ITemplate object matching the alias, or null.

    View Source

    GetTemplateDescendants(int)

    Gets the template descendants

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    IEnumerable<ITemplate> GetTemplateDescendants(int masterTemplateId)
    Parameters
    Type Name Description
    int masterTemplateId
    Returns
    Type Description
    IEnumerable<ITemplate>
    View Source

    GetTemplateFileContentStream(string)

    Gets the content of a template as a stream.

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    Stream GetTemplateFileContentStream(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the template.

    Returns
    Type Description
    Stream

    The content of the template.

    View Source

    GetTemplateFileSize(string)

    Gets the size of a template.

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    long GetTemplateFileSize(string filepath)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the template.

    Returns
    Type Description
    long

    The size of the template.

    View Source

    GetTemplates(int)

    Gets a list of all ITemplate objects

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    IEnumerable<ITemplate> GetTemplates(int masterTemplateId)
    Parameters
    Type Name Description
    int masterTemplateId
    Returns
    Type Description
    IEnumerable<ITemplate>

    An enumerable list of ITemplate objects

    View Source

    GetTemplates(params string[])

    Gets a list of all ITemplate objects

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    IEnumerable<ITemplate> GetTemplates(params string[] aliases)
    Parameters
    Type Name Description
    string[] aliases
    Returns
    Type Description
    IEnumerable<ITemplate>

    An enumerable list of ITemplate objects

    View Source

    SavePartialView(IPartialView, int?)

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    Attempt<IPartialView?> SavePartialView(IPartialView partialView, int? userId = null)
    Parameters
    Type Name Description
    IPartialView partialView
    int? userId
    Returns
    Type Description
    Attempt<IPartialView>
    View Source

    SaveScript(IScript?, int?)

    Saves a Script

    Declaration
    [Obsolete("Please use IScriptService for script operations - will be removed in Umbraco 15")]
    void SaveScript(IScript? script, int? userId = -1)
    Parameters
    Type Name Description
    IScript script

    IScript to save

    int? userId

    Optional id of the user saving the script

    View Source

    SaveStylesheet(IStylesheet?, int?)

    Saves a IStylesheet

    Declaration
    [Obsolete("Please use IStylesheetService for stylesheet operations - will be removed in Umbraco 15")]
    void SaveStylesheet(IStylesheet? stylesheet, int? userId = null)
    Parameters
    Type Name Description
    IStylesheet stylesheet

    IStylesheet to save

    int? userId

    Optional id of the user saving the stylesheet

    View Source

    SaveTemplate(IEnumerable<ITemplate>, int)

    Saves a collection of Template objects

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    void SaveTemplate(IEnumerable<ITemplate> templates, int userId = -1)
    Parameters
    Type Name Description
    IEnumerable<ITemplate> templates

    List of Template to save

    int userId

    Optional id of the user

    View Source

    SaveTemplate(ITemplate, int)

    Saves a ITemplate

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    void SaveTemplate(ITemplate template, int userId = -1)
    Parameters
    Type Name Description
    ITemplate template

    ITemplate to save

    int userId

    Optional id of the user saving the template

    View Source

    SetPartialViewFileContent(string, Stream)

    Sets the content of a partial view.

    Declaration
    [Obsolete("Please use IPartialViewService for partial view operations - will be removed in Umbraco 15")]
    void SetPartialViewFileContent(string filepath, Stream content)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the partial view.

    Stream content

    The content of the partial view.

    View Source

    SetScriptFileContent(string, Stream)

    Sets the content of a script file.

    Declaration
    [Obsolete("Please use IScriptService for script operations - will be removed in Umbraco 15")]
    void SetScriptFileContent(string filepath, Stream content)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the script.

    Stream content

    The content of the script file.

    View Source

    SetStylesheetFileContent(string, Stream)

    Sets the content of a stylesheet.

    Declaration
    [Obsolete("Please use IStylesheetService for stylesheet operations - will be removed in Umbraco 15")]
    void SetStylesheetFileContent(string filepath, Stream content)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the stylesheet.

    Stream content

    The content of the stylesheet.

    View Source

    SetTemplateFileContent(string, Stream)

    Sets the content of a template.

    Declaration
    [Obsolete("Please use ITemplateService for template operations - will be removed in Umbraco 15")]
    void SetTemplateFileContent(string filepath, Stream content)
    Parameters
    Type Name Description
    string filepath

    The filesystem path to the template.

    Stream content

    The content of the template.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX