Class FilesystemAbstract

Abstract base-class for remote filesystem implementations.

Hierarchy

Constructors

Methods

  • Open a readable stream for a file in the remote filesystem.

    Parameters

    • args: {
          storePath: string;
      }
      • storePath: string

    Returns Awaitable<Readable>

  • Protected

    Normalize the input tags into a single array of strings. This is useful for implementing the fluent interface for putLocalFile().

    Example

    const tags: string[] = this._normalizeTags(args.tag, args.tags)
    

    Parameters

    • Optional tag: string
    • Optional tags: string[]

    Returns string[]

  • Store a file from the local filesystem into the remote filesystem.

    Example

    await store.putLocalFile({
    localPath: '/tmp/temp.file',
    storePath: 'my/upload-key/temp.file',
    mimeType: 'application/json',
    tags: ['json', 'user-data'],
    })

    Parameters

    • args: {
          localPath: string;
          mimeType?: string;
          storePath: string;
          tag?: string;
          tags?: string[];
      }
      • localPath: string
      • Optional mimeType?: string
      • storePath: string
      • Optional tag?: string
      • Optional tags?: string[]

    Returns Awaitable<void>

  • Open a writable stream for a file in the remote filesystem.

    Parameters

    • args: {
          storePath: string;
      }
      • storePath: string

    Returns Awaitable<Writable>

  • Remove the given resource(s) from the remote filesystem.

    Parameters

    • args: {
          recursive?: boolean;
          storePath: string;
      }
      • Optional recursive?: boolean
      • storePath: string

    Returns Awaitable<void>

  • If the file does not exist in the remote filesystem, create it. If it does exist, update the modify timestamps.

    Parameters

    • args: {
          storePath: string;
      }
      • storePath: string

    Returns Awaitable<void>