Creates an instance of RemoteFileHandle.
file path
File base name
Once read, file content will be cached in this placeholder
Flag indicates whether the file is dirty
File extension
List of path segments
Once loaded, ready will be set to true and file meta-data will be stored in this place holder
File path
File protocol e.g:
os://
home://
Flag indicated whether the file meta-data is loaded
File type
Getter: Get the file basename Setter: set the file name
Getter: Get the file basename Setter: set the file name
Download a file
only work with file
Low level protocol-specific execute operation
This function should be overridden by the file handle class that supports the operation
Create sub directory
Only work on directory file handle
sub directory name
Move file/folder
Publish a file
Read remote file content.
If the current file is a directory, then the operation will return the meta-data of all files inside of the directory. Otherwise, file content will be returned
data type see read
Delete file/folder
Upload a file
Only work with directory file handle
Write file cache to the remote file
data type see write
Return the object itself
Convert the current file cache to Base64
type of the file cache:
object
mime type
promise on the converted data
Download the file.
Only work with file
This function calls the _down function to perform the operation
Promise on the operation result
Execute the current file.
This action depends on each file protocol
This function calls the _exec function to perform the operation
Remote file access link
Get hash number of the current file path
Check whether the current file is a hidden file
Check whether the current file is the root of the file tree
Read remote file meta-data
Sub-directory creation
This function calls the _mk function to perform the operation
sub directory name
promise on the operation result
Move the current file to another location
This function calls the _mv function to perform the operation
destination location
promise on the operation result
Load the file meta-data before performing any task
a promise on file meta-data
Get the parent file handle of the current file
Share the file by publish it.
Only work with file
This function calls the _pub function to perform the operation
promise on operation result
Public read operation
This function calls the _rd function to perform the operation.
If the current file is a directory, then the operation will return the meta-data of all files inside of the directory. Otherwise, file content will be returned
data type
a promise on the file content
Delete the file
This function calls the _rm function to perform the operation
promise on the operation result
Set data to the file cache
data object
Set a file path to the current file handle
Helper function returns a promise on unsupported action
action name
Upload a file to the current directory
Only work when the current file is a directory
This function calls the _up function to perform the operation
promise on the operation result
Write the file cache to the actual file
This function calls the _wr function to perform the operation
data type
base64
object
mime type
promise on the operation result
Remote file handle allows to perform file operation on AntOS remote server files. Its protocol is defined by the following pattern:
^(home|desktop|os|Untitled)$