Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Folder

Hierarchy

  • Folder

Implements

Index

Constructors

constructor

  • new Folder(client: Client, name: string, baseName: string, lastmod: string, id?: number): Folder
  • Parameters

    • client: Client
    • name: string
    • baseName: string
    • lastmod: string
    • Default value id: number = -1

    Returns Folder

Accessors

baseName

  • get baseName(): string

id

  • get id(): number

lastmod

  • get lastmod(): Date

name

  • get name(): string

Methods

addComment

  • addComment(comment: string): Promise<void>
  • add comment to folder

    Parameters

    • comment: string

      the comment

    Returns Promise<void>

addTag

  • addTag(tagName: string): Promise<void>
  • adds a tag name to the folder

    Parameters

    • tagName: string

      name of the tag

    Returns Promise<void>

containsFile

  • containsFile(fileBaseName: string): Promise<boolean>
  • throws

    Error

    Parameters

    • fileBaseName: string

      file basename

    Returns Promise<boolean>

    true if the folder contains a file with the given basename

createFile

  • createFile(fileBaseName: string, data: Buffer | ReadableStream): Promise<File>
  • creates a file in the folder

    throws

    Error

    Parameters

    • fileBaseName: string

      the base name of the file

    • data: Buffer | ReadableStream

      the buffer or stream with file content

    Returns Promise<File>

    the new file or null

createSubFolder

  • createSubFolder(subFolderBaseName: string): Promise<Folder>
  • creates a subfolder

    Parameters

    • subFolderBaseName: string

      name of the subfolder basename

    Returns Promise<Folder>

delete

  • delete(): Promise<void>
  • deletes the folder and the contained files

    throws

    Error

    Returns Promise<void>

getComments

  • getComments(top?: undefined | number, skip?: undefined | number): Promise<string[]>
  • get list of comments of folder

    throws

    Exception

    Parameters

    • Optional top: undefined | number

      number of comments to return

    • Optional skip: undefined | number

      the offset

    Returns Promise<string[]>

    array of comment strings

getFile

  • getFile(fileBaseName: string): Promise<File | null>
  • get a file by basename

    throws

    Error

    Parameters

    • fileBaseName: string

      the base name of the file

    Returns Promise<File | null>

    the file of null

getFiles

getSubFolders

  • getSubFolders(): Promise<Folder[]>

getTags

  • getTags(): Promise<string[]>
  • get tag names

    Returns Promise<string[]>

    array of tag names

getUIUrl

  • getUIUrl(): string
  • throws

    Error

    Returns string

    the url of the folder in the UI

getUrl

  • getUrl(): string

hasSubFolder

  • hasSubFolder(subFolderBaseName: string): Promise<boolean>
  • returns true if the current folder has a subfolder with the given base name

    Parameters

    • subFolderBaseName: string

      the base name of the subfolder like "products"

    Returns Promise<boolean>

move

  • move(targetFolderName: string): Promise<Folder>
  • renames or moves the current folder to the new location target folder must exists

    throws

    Error

    Parameters

    • targetFolderName: string

      the name of the target folder /f1/f2/target

    Returns Promise<Folder>

removeTag

  • removeTag(tagName: string): Promise<void>
  • removes a tag of the file

    Parameters

    • tagName: string

      the name of the tag

    Returns Promise<void>

Generated using TypeDoc