Filesystem
OS.js Virtual Filesystem
Constructor Summary
| Public Constructor | ||
| public |
constructor(core: Core, options: FilesystemOptions) Create new instance |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
call(options: FilesystemCallOptions): Promise<*> Performs a VFS request with simulated HTTP request |
|
| public |
Destroys instance |
|
| public |
Initializes Filesystem |
|
| public |
Gets MIME |
|
| public |
async mount(mount: Mountpoint): Mountpoint Mounts given mountpoint |
|
| public |
realpath(filename: string, user: AuthUserProfile): Promise<string> Creates realpath VFS request |
|
| public |
Crates a VFS request |
|
| public |
async unmount(mount: Mountpoint): Promise<boolean> Unmounts given mountpoint |
|
| public |
async watch(mountpoint: Mountpoint): Promise<undefined> Set up a watch for given mountpoint |
|
| Private Methods | ||
| private |
async _watch(mountpoint: Mountpoint, adapter: FilesystemAdapter): Promise<undefined> Internal method for setting up watch for given mountpoint adapter |
|
Public Constructors
public constructor(core: Core, options: FilesystemOptions) source
Create new instance
Params:
| Name | Type | Attribute | Description |
| core | Core | Core reference |
|
| options | FilesystemOptions |
|
Instance options |
Public Members
public adapters: FilesystemAdapterMap source
public mountpoints: Mountpoint[] source
public options: FilesystemOptions source
Public Methods
public call(options: FilesystemCallOptions): Promise<*> source
Performs a VFS request with simulated HTTP request
Params:
| Name | Type | Attribute | Description |
| options | FilesystemCallOptions | Request options |
|
| ...args | * | Arguments to pass to VFS method |
public mime(filename: string): string source
Gets MIME
Params:
| Name | Type | Attribute | Description |
| filename | string | Input filename or path |
public async mount(mount: Mountpoint): Mountpoint source
Mounts given mountpoint
Params:
| Name | Type | Attribute | Description |
| mount | Mountpoint | Mountpoint |
public realpath(filename: string, user: AuthUserProfile): Promise<string> source
Creates realpath VFS request
Params:
| Name | Type | Attribute | Description |
| filename | string | The path |
|
| user | AuthUserProfile |
|
User session object |
public request(req: Request | object, res: Response | object): Promise<*> source
Crates a VFS request
public async unmount(mount: Mountpoint): Promise<boolean> source
Unmounts given mountpoint
Params:
| Name | Type | Attribute | Description |
| mount | Mountpoint | Mountpoint |
public async watch(mountpoint: Mountpoint): Promise<undefined> source
Set up a watch for given mountpoint
Params:
| Name | Type | Attribute | Description |
| mountpoint | Mountpoint | The mountpoint |
Private Methods
private async _watch(mountpoint: Mountpoint, adapter: FilesystemAdapter): Promise<undefined> source
Internal method for setting up watch for given mountpoint adapter
Params:
| Name | Type | Attribute | Description |
| mountpoint | Mountpoint | The mountpoint |
|
| adapter | FilesystemAdapter | The adapter |
