Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IIOHelper

    Namespace: Umbraco.Cms.Core.IO
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IIOHelper

    Methods

    View Source

    CleanFolder(DirectoryInfo, TimeSpan)

    Cleans contents of a folder by deleting all files older that the provided age. If deletition of any file errors (e.g. due to a file lock) the process will continue to try to delete all that it can.

    Declaration
    CleanFolderResult CleanFolder(DirectoryInfo folder, TimeSpan age)
    Parameters
    Type Name Description
    DirectoryInfo folder

    Folder to clean.

    TimeSpan age

    Age of files within folder to delete.

    Returns
    Type Description
    CleanFolderResult

    Result of operation

    View Source

    EnsurePathExists(String)

    Declaration
    void EnsurePathExists(string path)
    Parameters
    Type Name Description
    System.String path
    View Source

    FindFile(String)

    Declaration
    string FindFile(string virtualPath)
    Parameters
    Type Name Description
    System.String virtualPath
    Returns
    Type Description
    System.String
    View Source

    GetRelativePath(String)

    Get properly formatted relative path from an existing absolute or relative path

    Declaration
    string GetRelativePath(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    System.String
    View Source

    GetTempFolders()

    Retrieves array of temporary folders from the hosting environment.

    Declaration
    DirectoryInfo[] GetTempFolders()
    Returns
    Type Description
    DirectoryInfo[]

    Array of instances.

    View Source

    MapPath(String)

    Maps a virtual path to a physical path in the content root folder (i.e. www)

    Declaration
    string MapPath(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    System.String
    View Source

    PathStartsWith(String, String, Char[])

    Declaration
    bool PathStartsWith(string path, string root, params char[] separators)
    Parameters
    Type Name Description
    System.String path
    System.String root
    System.Char[] separators
    Returns
    Type Description
    System.Boolean
    View Source

    ResolveUrl(String)

    Declaration
    string ResolveUrl(string virtualPath)
    Parameters
    Type Name Description
    System.String virtualPath
    Returns
    Type Description
    System.String
    View Source

    VerifyEditPath(String, IEnumerable<String>)

    Verifies that the current filepath matches one of several directories where the user is allowed to edit a file.

    Declaration
    bool VerifyEditPath(string filePath, IEnumerable<string> validDirs)
    Parameters
    Type Name Description
    System.String filePath

    The filepath to validate.

    IEnumerable<System.String> validDirs

    The valid directories.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the filepath is valid.

    View Source

    VerifyEditPath(String, String)

    Verifies that the current filepath matches a directory where the user is allowed to edit a file.

    Declaration
    bool VerifyEditPath(string filePath, string validDir)
    Parameters
    Type Name Description
    System.String filePath

    The filepath to validate.

    System.String validDir

    The valid directory.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the filepath is valid.

    View Source

    VerifyFileExtension(String, IEnumerable<String>)

    Verifies that the current filepath has one of several authorized extensions.

    Declaration
    bool VerifyFileExtension(string filePath, IEnumerable<string> validFileExtensions)
    Parameters
    Type Name Description
    System.String filePath

    The filepath to validate.

    IEnumerable<System.String> validFileExtensions

    The valid extensions.

    Returns
    Type Description
    System.Boolean

    A value indicating whether the filepath is valid.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • CleanFolder(DirectoryInfo, TimeSpan)
      • EnsurePathExists(String)
      • FindFile(String)
      • GetRelativePath(String)
      • GetTempFolders()
      • MapPath(String)
      • PathStartsWith(String, String, Char[])
      • ResolveUrl(String)
      • VerifyEditPath(String, IEnumerable<String>)
      • VerifyEditPath(String, String)
      • VerifyFileExtension(String, IEnumerable<String>)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX