Handles interaction with the Server's File System

Constructors

Properties

Methods

  • Compresses the Files at the given paths

    Parameters

    • paths: string[]

      An array of Paths to Compress

    • to: string

      The Directory to write the Compressed Files to

    Returns Promise<void>

    Remarks

    ⚠️ The resulting file appears to be unpredictably named?

    Throws

    "Unexpected response code, Compress may not have succeeded" If the API returns anything other than a 204, something likely went wrong. Most commonly, this is because the source or destination path did not exist or was not Compressable

  • Copies the File at the given path

    Parameters

    • path: string

      The full path to the File to Copy

    Returns Promise<void>

    Remarks

    ⚠️ New copy will be written to the same directory, with a name such as test.txt -> test.txt copy-1643810941850

    Throws

    "Unexpected response code, Copy may not have succeeded" If the API returns anything other than a 204, something likely went wrong. Most commonly, this is because the file path didn't exist or wasn't copyable.

  • Creates a Directory with the given path

    Parameters

    • path: string

      The full path to the new Directory

    Returns Promise<void>

    Remarks

    ⚠️ This will silently fail if the given path is present and invalid or unreachable ⚠️ This is always relative to the Server's default directory (usually /home/container)

  • Decompresses the File at the given path

    Parameters

    • path: string

      The full path to the File to Decompress

    Returns Promise<void>

    Throws

    "Unexpected response code, Decompress may not have succeeded" If the API returns anything other than a 204, something likely went wrong. Most commonly, this is because the given path did not exist or was not reachable

  • Deletes the Files at all of the given paths

    Parameters

    • paths: string[]

      An array of File Paths to Delete

    Returns Promise<void>

    Throws

    "Unexpected response code, Delete may not have succeeded" If the API returns anything other than a 204, something likely went wrong. Most commonly, this is because the file path didn't exist or wasn't deleteable.

  • Retrieves a Download URL for a File

    Parameters

    • path: string

      The full path to the File

    Returns Promise<string>

    Remarks

    ⚠️ This will return a Download URL even if the given file does not exist

  • Retrieves the contents of the File at the given path

    Parameters

    • path: string

      The full path to the File to read (After the /home/container/ part)

    Returns Promise<string>

    Throws

    "Server returned error code: {number}" This error is often thrown if the given path doesn't exist, or is not readable. The error code would be 404.

  • Renames (or moves) the given File

    Parameters

    • path: string

      The full path to the File

    • to: string

      The new path of the File

    Returns Promise<void>

    Throws

    "Unexpected response code, Rename may not have succeeded" If the API returns anything other than a 204, something likely went wrong. Most commonly, this is because the source or destination path did not exist or was not reachable

  • Writes the given content to the File at the given path

    Parameters

    • path: string

      The full path to the File

    • content: string

      The full content of the File

    Returns Promise<void>

    Remarks

    ⚠️ Overwrites the file if it already exists ⚠️ This function silently fails if the target path is not writeable

Generated using TypeDoc