@backblaze-labs/b2-sdk - v0.2.0
    Preparing search index...

    Class CopyAction

    Server-side copies a B2 file to a new key within the same or different bucket.

    Implements

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a new CopyAction for the given relative path.

      Parameters

      • relativePath: string

        Path relative to the sync root.

      • size: number

        File size in bytes.

      • doCopy: (relativePath: string, signal?: AbortSignal) => Promise<void>

        Callback that performs the server-side copy.

      Returns CopyAction

    Properties

    relativePath: string

    Path relative to the sync root.

    size: number

    File size in bytes.

    type: "copy" = ...

    The kind of action.

    Methods

    • Copies the file (unless dryRun) and returns a 'copy-done' event.

      Parameters

      • dryRun: boolean

        Whether to simulate the action without making changes.

      • Optionalsignal: AbortSignal

        Optional abort signal for canceling the copy.

      Returns Promise<SyncEvent>

      A promise resolving to the sync event produced by the action.