Class FileFactory

Hierarchy

Constructors

  • Creates a new file object which represents the file at the given ID

    Data provided to the constructor will be uploaded by invoking upload().

    Returns

    A new file instance

    Parameters

    • fileOptions: FileOptions

      The fileOptions used to create a new file object, or just the id of the file object

    Returns File

Properties

db: EntityManager = ...

The owning EntityManager where this factory belongs to

prototype: File = ...
type: Class<File> = ...

Methods

  • Deserialize the file metadata from a json object back to a new file instance

    Returns

    The deserialize File instance

    Parameters

    • json: JsonMap

      The file metadata as json

    Returns File

  • Lists all the buckets.

    Returns

    The listed buckets.

    Parameters

    • Optional doneCallback: any

      The callback is invoked with the listed buckets

    • Optional failCallback: any

      The callback is invoked if any error has occurred

    Returns Promise<File[]>

  • Lists the files (and folders) in the given folder.

    Returns

    The listed files/folders.

    Parameters

    • folderOrPath: string | File

      The folder/path to list.

    • start: File

      The file/folder from where to start listing (not included)

    • count: number

      The maximum number of files to return.

    • Optional doneCallback: any

      The callback is invoked with the listed files

    • Optional failCallback: any

      The callback is invoked if any error has occurred

    Returns Promise<File[]>

  • Gets the metadata of the root folder (formally the file "bucket")

    Returns

    A promise which will be fulfilled with the bucket ACLs

    Parameters

    • bucket: string

      The name of the root file directory

    • Optional options: {
          refresh?: boolean;
      }

      The load metadata options

      • Optional refresh?: boolean

        Force a revalidation while fetching the metadata

    • Optional doneCallback: any

      The callback is invoked after the metadata is fetched

    • Optional failCallback: any

      The callback is invoked if any error has occurred

    Returns Promise<RootFolderMetadata>

  • Creates a new instance of the factory type

    Returns

    A new created instance of *

    Instance

    Parameters

    • Rest ...args: any[]

      Constructor arguments used for instantiation

    Returns File

  • Creates a new file

    Returns

    A new created file

    Parameters

    • args: [FileOptions]

      Constructor arguments used for instantiation, the constructor will not be called when no arguments are passed

    Returns File

  • Updates the metadata of the root file directory formally the file "bucket"

    Returns

    A promise which will fulfilled with the updated metadata

    Parameters

    • bucket: string

      The name of the root file directory

    • metadata: RootFolderMetadata

      The new metadata for the bucket

    • Optional doneCallback: any

      Invoked if the operation succeeds

    • Optional failCallback: any

      The callback is invoked if any error has occurred

    Returns Promise<any>

  • Creates a new Factory for the given type

    Returns

    A new object factory to created instances of T

    Type Parameters

    Parameters

    • this: Class<F>
    • type: Class<T>

      the type constructor of T

    Returns F & InstanceFactory<T>

Generated using TypeDoc