Represents a connector for interacting with an object store.

interface IObjectStoreConnector {
    calculateSize(path: string): Promise<number>;
    createFolder(path: string): Promise<IFolderDescriptor>;
    createWritableStream(path: string, options?: IFileOptions): Promise<IWritableStream>;
    deleteObject(path: string): Promise<ObjectKind>;
    get(path: string, options?: IFileOptions): Promise<IFile>;
    list(path: string, recursive: boolean): Promise<ObjectDescriptor[]>;
    moveObject(path: string, newPath: string): Promise<ObjectKind>;
    writeFile(file: File, path?: string, options?: IFileOptions): Promise<IFileDescriptor>;
}

Methods

  • Calculates the size of an object.

    Parameters

    • path: string

      The path to the object.

    Returns Promise<number>

    A promise that resolves with the size of the object.

  • Deletes an object.

    Parameters

    • path: string

      The path to the object.

    Returns Promise<ObjectKind>

    A promise that resolves with the object kind.

  • Gets a file.

    Parameters

    • path: string

      The path to the file.

    • Optionaloptions: IFileOptions

      The options for writing the file.

    Returns Promise<IFile>

    A promise that resolves with the file.

  • Lists the objects in a folder.

    Parameters

    • path: string

      The path to the folder.

    • recursive: boolean

      Whether to list the objects recursively.

    Returns Promise<ObjectDescriptor[]>

    A promise that resolves with an array of object descriptors.

  • Moves an object.

    Parameters

    • path: string

      The path to the object.

    • newPath: string

      The path to move the object to.

    Returns Promise<ObjectKind>

    A promise that resolves with the object kind.

  • Writes a file.

    Parameters

    • file: File

      The file to write.

    • Optionalpath: string

      The path to write the file to.

    • Optionaloptions: IFileOptions

      The options for writing the file.

    Returns Promise<IFileDescriptor>

    A promise that resolves with the file descriptor.