Belin.io Core
    Preparing search index...

    Class NetworkDrive

    Represents a Windows network drive.

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Creates a new network drive.

      Parameters

      • drive: string

        The drive letter.

      • uncPath: string

        The underlying UNC path.

      • user: string = ""

        The username to use for mounting this network drive.

      • password: string = ""

        The password to use for mounting this network drive.

      Returns NetworkDrive

    Properties

    drive: string

    The drive letter.

    uncPath: string

    The underlying UNC path.

    Accessors

    • get isMounted(): Promise<boolean>

      Value indicating whether this network drive is mounted.

      Returns Promise<boolean>

    Methods

    • Mounts this network drive.

      Parameters

      • options: { persistent?: boolean } = {}

        Value indicating whether to use a persistent network connection.

      Returns Promise<void>

      Resolves when the command has been completed.

    • Resolves the specified UNC path into a local path.

      Parameters

      • path: string

        The UNC path to resolve.

      Returns string

      The resolved local path.

    • Unmounts this network drive.

      Returns Promise<void>

      Resolves when the command has been completed.

    • Creates a new network drive from the specified file URI.

      Parameters

      • uri: URL

        A file URI representing a UNC path.

      Returns NetworkDrive

      The network drive corresponding to the specified file URI.

    • Returns the local path corresponding to the specified file URI.

      Parameters

      • uri: URL

        A file URI representing a local or UNC path.

      • options: { mount?: boolean; persistent?: boolean } = {}

        Values indicating whether to mount the network drive if necessary.

      Returns Promise<string>

      The local path corresponding to the specified file URI.