Home Reference Source Test
public class | source

File

Represents a file inside an artifact.

Constructor Summary

Public Constructor
public

constructor(path: String, filename: String, absolutePath: String)

Member Summary

Public Members
public

An absolute path to the underlying file

public get

The determined mime type for the file

public get

data: *

public

The S3 key which represents this file (path + filename)

Method Summary

Public Methods
public

async upload(opts: Object): string

Uploads the file to the specific remote S3 bucket, using the supplied credentials and an optional prefix.

Public Constructors

public constructor(path: String, filename: String, absolutePath: String) source

Params:

NameTypeAttributeDescription
path String

the path to the file inside the artifact

filename String

The name of the file, including the extension name

absolutePath String

An absolute path to the underlying file

Public Members

public absolutePath: String source

An absolute path to the underlying file

public get contentType: String source

The determined mime type for the file

public get data: * source

public key: String source

The S3 key which represents this file (path + filename)

Public Methods

public async upload(opts: Object): string source

Uploads the file to the specific remote S3 bucket, using the supplied credentials and an optional prefix.

Params:

NameTypeAttributeDescription
opts Object

An options object

opts.bucket String

The bucket to upload the file to.

opts.credentials Credentials

An instantiated AWS.Credentials object.

opts.prefix String

An optional prefix to apply to this file.

Return:

string