Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FileSystemProviderWithAccessCapability

Subtype of FileSystemProvider that ensures that the optional functions needed for providers, that should be able access files, are implemented.

Hierarchy

Index

Properties

Readonly capabilities

The FileSystemProviderCapabilities for this provider.

Readonly onDidChangeCapabilities

onDidChangeCapabilities: Event<void>

Event that is fired if the capabilities of this provider have changed.

Readonly onDidChangeFile

onDidChangeFile: Event<readonly FileChange[]>

Event that is fired if a (watched) file in the filesystem of this provider has changed.

Readonly onFileWatchError

onFileWatchError: Event<void>

Event that is fired if an error occurred when watching files in the filesystem of this provider.

Methods

access

  • access(resource: default, mode?: number): Promise<void>
  • Test if the user has the permission to access the given file in the specified mode.

    Parameters

    • resource: default

      The URI of the file that should be tested.

    • Optional mode: number

      The access mode that should be tested.

    Returns Promise<void>

    A promise that resolves if the user has the required permissions, should be rejected otherwise.

Optional close

  • close(fd: number): Promise<void>

Optional copy

delete

  • Delete the given resource.

    Parameters

    • resource: default

      The URI of the resource to delete.

    • opts: FileDeleteOptions

      Options to define if files should be deleted recursively and if the trash should be used.

    Returns Promise<void>

fsPath

  • fsPath(resource: default): Promise<string>
  • Derive the platform specific file system path that is represented by the resource.

    Parameters

    • resource: default

      URI of the resource to derive the path from.

    Returns Promise<string>

    A promise of the corresponding file system path.

mkdir

  • mkdir(resource: default): Promise<void>
  • Create a new directory using the given resource uri.

    Parameters

    • resource: default

      The URI of the new folder.

    Returns Promise<void>

Optional open

Optional read

  • read(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>

Optional readFile

  • readFile(resource: default): Promise<Uint8Array>

Optional readFileStream

  • readFileStream(resource: default, opts: FileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array>

readdir

  • readdir(resource: default): Promise<[string, FileType][]>
  • Retrieve the content of a given directory.

    Parameters

    • resource: default

      The URI of the directory.

    Returns Promise<[string, FileType][]>

    A map containing the FileType for each child resource, identified by name.

rename

  • Rename a file or folder.

    Parameters

    • from: default

      URI of the existing file or folder.

    • to: default

      URI of the target location.

    • opts: FileOverwriteOptions

      Options to define if existing files should be overwritten.

    Returns Promise<void>

stat

  • stat(resource: default): Promise<Stat>

Optional updateFile

watch

  • Watch the given resource and react to changes by firing the {@link FileSystemProvider#onDidChangeFile} event.

    Parameters

    • resource: default

      URI of the resource to be watched.

    • opts: WatchOptions

      Options to define if the resource should be watched recursively and to provide a set of resources that should be excluded from watching.

    Returns Disposable

    A Disposable that can be invoked to stop watching the resource.

Optional write

  • write(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise<number>

Optional writeFile

  • writeFile(resource: default, content: Uint8Array, opts: FileWriteOptions): Promise<void>