Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    FileSystemProvider Class

    Namespace: Stride.Core.IO
    Assembly: Stride.Core.IO.dll

    A file system implementation for IVirtualFileProvider.

    System.Object → VirtualFileProviderBase → FileSystemProvider
    Derived from FileSystemProvider: DriveFileProvider

    public class FileSystemProvider : VirtualFileProviderBase, IVirtualFileProvider, IDisposable
    Name Description
    Constructors
    FileSystemProvider(String, String)

    Initializes a new instance of the FileSystemProvider class with the given base path.

    Fields
    AltDirectorySeparatorChar
    DirectorySeparatorChar
    VolumeSeparatorChar
    Methods
    ChangeBasePath(String)
    ConvertFullPathToUrl(String)
    ConvertUrlToFullPath(String)
    CreateDirectory(String)

    Creates all directories so that url exists.

    DirectoryExists(String)
    FileDelete(String)

    Deletes the specified file.

    FileExists(String)

    Determines whether the specified path points to an existing file.

    FileMove(String, IVirtualFileProvider, String)

    Move the specified file specified from its sourceUrl to the location pointed by destinationUrl in the destination provider. Do not overwrite, throw IOException if the file can't be moved.

    FileMove(String, String)

    Move the specified file specified from its sourceUrl to the location pointed by destinationUrl. Do not overwrite, throw IOException if the file can't be moved.

    FileSize(String)
    GetAbsolutePath(String)
    GetLastWriteTime(String)
    ListFiles(String, String, VirtualSearchOption)

    Returns the list of files from the specified path.

    OpenStream(String, VirtualFileMode, VirtualFileAccess, VirtualFileShare, StreamFlags)

    Opens a Stream from the specified path.

    TryGetFileLocation(String, out String, out Int64, out Int64)

    Gets the absolute path and location if the specified path physically exist on the disk in an uncompressed form (could be inside another file).

    | Improve this Doc View Source

    Constructors


    FileSystemProvider(String, String)

    Initializes a new instance of the FileSystemProvider class with the given base path.

    public FileSystemProvider(string rootPath, string localBasePath)
    Parameters
    Type Name Description
    System.String rootPath

    The root path of this provider.

    System.String localBasePath

    The path to a local directory where this instance will load the files from.

    | Improve this Doc View Source

    Fields


    AltDirectorySeparatorChar

    public static readonly char AltDirectorySeparatorChar
    Field Value
    Type Description
    System.Char

    DirectorySeparatorChar

    public static readonly char DirectorySeparatorChar
    Field Value
    Type Description
    System.Char

    VolumeSeparatorChar

    public static readonly char VolumeSeparatorChar
    Field Value
    Type Description
    System.Char
    | Improve this Doc View Source

    Methods


    ChangeBasePath(String)

    public void ChangeBasePath(string basePath)
    Parameters
    Type Name Description
    System.String basePath

    ConvertFullPathToUrl(String)

    protected virtual string ConvertFullPathToUrl(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    System.String

    ConvertUrlToFullPath(String)

    protected virtual string ConvertUrlToFullPath(string url)
    Parameters
    Type Name Description
    System.String url
    Returns
    Type Description
    System.String

    CreateDirectory(String)

    Creates all directories so that url exists.

    public override void CreateDirectory(string url)
    Parameters
    Type Name Description
    System.String url

    The URL.

    Overrides
    VirtualFileProviderBase.CreateDirectory(String)

    DirectoryExists(String)

    public override bool DirectoryExists(string url)
    Parameters
    Type Name Description
    System.String url
    Returns
    Type Description
    System.Boolean
    Overrides
    VirtualFileProviderBase.DirectoryExists(String)

    FileDelete(String)

    Deletes the specified file.

    public override void FileDelete(string url)
    Parameters
    Type Name Description
    System.String url

    The URL.

    Overrides
    VirtualFileProviderBase.FileDelete(String)

    FileExists(String)

    Determines whether the specified path points to an existing file.

    public override bool FileExists(string url)
    Parameters
    Type Name Description
    System.String url

    The path.

    Returns
    Type Description
    System.Boolean
    Overrides
    VirtualFileProviderBase.FileExists(String)

    FileMove(String, IVirtualFileProvider, String)

    Move the specified file specified from its sourceUrl to the location pointed by destinationUrl in the destination provider. Do not overwrite, throw IOException if the file can't be moved.

    public override void FileMove(string sourceUrl, IVirtualFileProvider destinationProvider, string destinationUrl)
    Parameters
    Type Name Description
    System.String sourceUrl

    The source URL.

    IVirtualFileProvider destinationProvider

    The destination provider.

    System.String destinationUrl

    The destination URL, relative to the destination provider.

    Overrides
    VirtualFileProviderBase.FileMove(String, IVirtualFileProvider, String)

    FileMove(String, String)

    Move the specified file specified from its sourceUrl to the location pointed by destinationUrl. Do not overwrite, throw IOException if the file can't be moved.

    public override void FileMove(string sourceUrl, string destinationUrl)
    Parameters
    Type Name Description
    System.String sourceUrl

    The source URL of the file

    System.String destinationUrl

    The destination URL of the file

    Overrides
    VirtualFileProviderBase.FileMove(String, String)

    FileSize(String)

    public override long FileSize(string url)
    Parameters
    Type Name Description
    System.String url
    Returns
    Type Description
    System.Int64
    Overrides
    VirtualFileProviderBase.FileSize(String)

    GetAbsolutePath(String)

    public override string GetAbsolutePath(string path)
    Parameters
    Type Name Description
    System.String path
    Returns
    Type Description
    System.String
    Overrides
    VirtualFileProviderBase.GetAbsolutePath(String)

    GetLastWriteTime(String)

    public override DateTime GetLastWriteTime(string url)
    Parameters
    Type Name Description
    System.String url
    Returns
    Type Description
    System.DateTime
    Overrides
    VirtualFileProviderBase.GetLastWriteTime(String)

    ListFiles(String, String, VirtualSearchOption)

    Returns the list of files from the specified path.

    public override string[] ListFiles(string url, string searchPattern, VirtualSearchOption searchOption)
    Parameters
    Type Name Description
    System.String url
    System.String searchPattern

    The search pattern.

    VirtualSearchOption searchOption

    The search option.

    Returns
    Type Description
    System.String[]

    A list of files from the specified path

    Overrides
    VirtualFileProviderBase.ListFiles(String, String, VirtualSearchOption)

    OpenStream(String, VirtualFileMode, VirtualFileAccess, VirtualFileShare, StreamFlags)

    Opens a Stream from the specified path.

    public override Stream OpenStream(string url, VirtualFileMode mode, VirtualFileAccess access, VirtualFileShare share = VirtualFileShare.Read, StreamFlags streamFlags = StreamFlags.None)
    Parameters
    Type Name Description
    System.String url
    VirtualFileMode mode

    The mode.

    VirtualFileAccess access

    The access.

    VirtualFileShare share

    The process sharing mode.

    StreamFlags streamFlags

    The type of stream needed

    Returns
    Type Description
    System.IO.Stream

    The opened stream.

    Overrides
    VirtualFileProviderBase.OpenStream(String, VirtualFileMode, VirtualFileAccess, VirtualFileShare, StreamFlags)

    TryGetFileLocation(String, out String, out Int64, out Int64)

    Gets the absolute path and location if the specified path physically exist on the disk in an uncompressed form (could be inside another file).

    public override bool TryGetFileLocation(string path, out string filePath, out long start, out long end)
    Parameters
    Type Name Description
    System.String path

    The path.

    System.String filePath

    The file containing the data.

    System.Int64 start

    The start offset in the file.

    System.Int64 end

    The end offset in the file (can be -1 if full file).

    Returns
    Type Description
    System.Boolean

    True if success, false if not supported and entry is found (note: even when true, the file might not actually exists).

    Overrides
    VirtualFileProviderBase.TryGetFileLocation(String, out String, out Int64, out Int64)

    Inherited Members

    VirtualFileProviderBase.RootPath
    VirtualFileProviderBase.ResolvePath(String)
    VirtualFileProviderBase.Dispose()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article
    In This Article
    • Constructors
      • FileSystemProvider(String, String)
    • Fields
      • AltDirectorySeparatorChar
      • DirectorySeparatorChar
      • VolumeSeparatorChar
    • Methods
      • ChangeBasePath(String)
      • ConvertFullPathToUrl(String)
      • ConvertUrlToFullPath(String)
      • CreateDirectory(String)
      • DirectoryExists(String)
      • FileDelete(String)
      • FileExists(String)
      • FileMove(String, IVirtualFileProvider, String)
      • FileMove(String, String)
      • FileSize(String)
      • GetAbsolutePath(String)
      • GetLastWriteTime(String)
      • ListFiles(String, String, VirtualSearchOption)
      • OpenStream(String, VirtualFileMode, VirtualFileAccess, VirtualFileShare, StreamFlags)
      • TryGetFileLocation(String, out String, out Int64, out Int64)
    • Inherited Members
    • Extension Methods

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation