Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FilesClient

Hierarchy

  • FilesClient

Index

Constructors

constructor

Methods

compressFile

  • compressFile(serverID: string, args: { files: string[]; root: string }): Promise<IClientServerFile>
  • Compress one or more files

    Parameters

    • serverID: string

      Server Identifier

    • args: { files: string[]; root: string }

      the folder and file names to be compressed

      • files: string[]
      • root: string

    Returns Promise<IClientServerFile>

    the compressed file

copy

  • copy(serverID: string, location: string): Promise<boolean>
  • Copy a file from the location

    Parameters

    • serverID: string

      Server Identifier

    • location: string

      The location to copy

    Returns Promise<boolean>

    if the operation is successful or not ({@link boolean})

createFolder

  • createFolder(serverID: string, args: { name: string; root: string }): Promise<boolean>
  • Create a folder

    Parameters

    • serverID: string

      Server Identifier

    • args: { name: string; root: string }

      The arguments:

      • root - root directory
      • name - the folder name
      • name: string
      • root: string

    Returns Promise<boolean>

    if the operation is successful or not ({@link boolean})

decompressFile

  • decompressFile(serverID: string, args: { files: string[]; root: string }): Promise<boolean>
  • Decompress a file from it's compressed form

    Parameters

    • serverID: string

      Server Identifier

    • args: { files: string[]; root: string }

      the folder and file names to be decompressed

      • files: string[]
      • root: string

    Returns Promise<boolean>

    if the operation is successful or not ({@link boolean})

deleteFile

  • deleteFile(serverID: string, args: { files: string[]; root: string }): Promise<boolean>
  • Delete the specified file or folder

    Parameters

    • serverID: string

      Server Identifier

    • args: { files: string[]; root: string }

      The arguments:

      • root - the folder
      • files - an array of file name to delete
      • files: string[]
      • root: string

    Returns Promise<boolean>

    if the operation is successful or not ({@link boolean})

getAll

getContents

  • getContents(serverID: string, file: string): Promise<string>
  • Get the content of the specified file

    Parameters

    • serverID: string

      Server Identifier

    • file: string

      The path to the file

    Returns Promise<string>

    The file content

getDownloadUri

  • getDownloadUri(serverID: string, file: string): Promise<string>
  • Get the URL to download the given file

    Parameters

    • serverID: string

      Server Identifier

    • file: string

      the file name to get the download link from

    Returns Promise<string>

    a {@link String} of the download link

getUploadFileUri

  • getUploadFileUri(serverID: string): Promise<string>
  • Get a file URI link to upload to the specified server

    Parameters

    • serverID: string

      Server Identifier

    Returns Promise<string>

    the URL

uploadFile

  • uploadFile(serverID: string, files: { buffer: Buffer; filename: string }[], directory?: string): Promise<true>
  • Upload a file to the specified directory

    Parameters

    • serverID: string

      Server Identifier

    • files: { buffer: Buffer; filename: string }[]
    • Optional directory: string

    Returns Promise<true>

    true if the operation is successful

write

  • write(serverID: string, fileName: string, content: string): Promise<boolean>
  • Writes a data to the given file and directory

    Parameters

    • serverID: string

      Identifier

    • fileName: string

      The file name to write to

    • content: string

    Returns Promise<boolean>

    if the operation is successful or not ({@link boolean})

Generated using TypeDoc