Filesystem
Extends:
Filesystem Class that manages filesystems and adapters
Constructor Summary
Public Constructor | ||
public |
constructor(core: Core, options: FilesystemOptions) Create filesystem manager |
Member Summary
Public Members | ||
public |
adapters: {name: FilesystemAdapterWrapper} Adapter registry |
|
public |
Core instance reference |
|
public |
Mountpoints |
|
public |
Options |
|
public |
A wrapper for VFS method requests |
Method Summary
Public Methods | ||
public |
addMountpoint(props: FilesystemMountpoint, automount: boolean): Promise<boolean> Adds a new mountpoint |
|
public |
Creates a new mountpoint based on given properties |
|
public |
getMountpointFromPath(file: string | VFSFile): FilesystemMountpoint | null Gets mountpoint from given path |
|
public |
getMounts(all: boolean): FilesystemMountpoint[] Gets all mountpoints |
|
public |
mount(m: string | FilesystemMountpoint): Promise<boolean> Mount given mountpoint |
|
public |
Mounts all configured mountpoints |
|
public |
Gets the proxy for VFS methods FIXME: Not correct type, but works for documentation atm |
|
public |
Unmount given filesystem |
Private Methods | ||
private |
Gets configured mountpoints |
|
private |
_mountAction(name: string, unmount: boolean): Promise<boolean> Internal wrapper for mounting/unmounting by name |
|
private |
_mountpointAction(mountpoint: FilesystemMountpoint, unmount: boolean): Promise<boolean> Internal wrapper for mounting/unmounting |
|
private |
Perform a VFS method request |
|
private |
_requestAction(method: string): Promise<*> Request action wrapper |
Public Constructors
public constructor(core: Core, options: FilesystemOptions) source
Create filesystem manager
Params:
Name | Type | Attribute | Description |
core | Core | Core reference |
|
options | FilesystemOptions |
|
Options |
Public Members
Public Methods
public addMountpoint(props: FilesystemMountpoint, automount: boolean): Promise<boolean> source
Adds a new mountpoint
Params:
Name | Type | Attribute | Description |
props | FilesystemMountpoint | Mountpoint props |
|
automount | boolean |
|
Automount after creation |
public createMountpoint(props: FilesystemMountpoint): FilesystemMountpoint source
Creates a new mountpoint based on given properties
Params:
Name | Type | Attribute | Description |
props | FilesystemMountpoint | Properties |
public getMountpointFromPath(file: string | VFSFile): FilesystemMountpoint | null source
Gets mountpoint from given path
public getMounts(all: boolean): FilesystemMountpoint[] source
Gets all mountpoints
Params:
Name | Type | Attribute | Description |
all | boolean |
|
public mount(m: string | FilesystemMountpoint): Promise<boolean> source
Mount given mountpoint
Params:
Name | Type | Attribute | Description |
m | string | FilesystemMountpoint | Mountpoint name or object |
Throw:
On invalid name or if already mounted |
public mountAll(stopOnError: boolean): Promise<boolean[]> source
Mounts all configured mountpoints
Params:
Name | Type | Attribute | Description |
stopOnError | boolean |
|
Stop on first error |
public request(): FilesystemAdapterMethods source
Gets the proxy for VFS methods FIXME: Not correct type, but works for documentation atm
public unmount(name: string): Promise<boolean> source
Unmount given filesystem
Params:
Name | Type | Attribute | Description |
name | string | Filesystem name |
Throw:
On invalid name or if already unmounted |
Private Methods
private _mountAction(name: string, unmount: boolean): Promise<boolean> source
Internal wrapper for mounting/unmounting by name
private _mountpointAction(mountpoint: FilesystemMountpoint, unmount: boolean): Promise<boolean> source
Internal wrapper for mounting/unmounting
Params:
Name | Type | Attribute | Description |
mountpoint | FilesystemMountpoint | The mountpoint |
|
unmount | boolean |
|
If action is unmounting |