-
__processError
(error, onError)
private
-
Name |
Type |
Description |
error |
*
|
Error |
onError |
function
|
optional
Callback function upon completion of an operation with error |
- Since:
-
-
Returns true is the entity is same
- Since:
Returns:
Type |
Description |
Boolean
|
Entity is same |
-
-
Returns true if the entity exists
- Version:
Returns:
Type |
Description |
Boolean
|
Entity exists |
-
-
Returns the absolute path
- Since:
Returns:
Type |
Description |
String
|
Absolute path |
-
-
Returns the extension of the entity
- Since:
Returns:
Type |
Description |
String
|
Extension of the entity |
-
-
Returns the full name
- Version:
- Since:
Returns:
Type |
Description |
String
|
Full name |
-
-
Returns the full path
- Version:
Returns:
Type |
Description |
String
|
Full Path |
-
-
Returns the name of the entity without an extension
- Since:
Returns:
Type |
Description |
String
|
Name of the entity without an extension |
-
-
Returns the path
- Since:
Returns:
Type |
Description |
String
|
Path |
-
-
Returns a stats
Returns an object with 2 properties:
status - Result of an operation
data - Loaded data
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_CALLBACK_IS_NOT_AVAILABLE
DKTools.IO.ERROR_OPTIONS_ARE_NOT_AVAILABLE
Name |
Type |
Description |
object |
Object
|
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of stat |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
- Since:
Returns:
Type |
Description |
Object
|
Loaded stats |
-
getStatsAsync
()Promise.<Object>
async
-
Returns a stats
Asynchronous version of DKTools.IO.Entity.prototype.getStats
Promise resolves an object with 2 properties:
status - Result of an operation
data - Loaded data
if the status is not equal to DKTools.IO.OK then data will be null
Possible statuses:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
- Version:
- Since:
Returns:
Type |
Description |
Promise.<Object>
|
Loaded stats |
-
-
Returns true if the entity has an extension
- Since:
Returns:
Type |
Description |
Boolean
|
Entity has an extension |
-
-
Initializes the entity
Name |
Type |
Description |
fullPath |
String
|
Path to entity |
- Version:
- Since:
-
-
Returns true if the entity is a directory
- Version:
- Since:
Returns:
Type |
Description |
Boolean
|
Entity is a directory |
-
-
Returns true if the entity is a file
- Version:
- Since:
Returns:
Type |
Description |
Boolean
|
Entity is a file |
-
rename
(newName, object)Number
-
Renames the entity (file or directory)
Returns a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.EXPECT_CALLBACK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OVERWRITING_IS_NOT_AVAILABLE
Name |
Type |
Default |
Description |
newName |
String
|
|
New name of entity (file or directory) without the extension |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
sync |
Boolean
|
optional
Use synchronous version of rename |
overwrite |
Boolean
|
optional
Overwrite existing entity |
onSuccess |
function
|
optional
Callback function upon completion of an operation (only for object.sync == false) |
onError |
function
|
optional
Callback function upon completion of an operation with error (only for object.sync == false) |
|
- Version:
Returns:
Type |
Description |
Number
|
Code of the result of an operation |
-
renameAsync
(newName, object)Promise.<Number>
async
-
Renames the entity (file or directory)
Asynchronous version of DKTools.IO.Entity.prototype.rename
Promise resolves a code of the result of an operation
Possible results:
DKTools.IO.OK
DKTools.IO.ERROR_NOT_LOCAL_MODE
DKTools.IO.ERROR_PATH_DOES_NOT_EXIST
DKTools.IO.ERROR_OVERWRITING_IS_NOT_AVAILABLE
Name |
Type |
Default |
Description |
newName |
String
|
|
New name of entity without the extension |
object |
Object
|
{}
|
optional
Options of an operation
Name |
Type |
Description |
overwrite |
Boolean
|
optional
Overwrite existing entity |
|
- Version:
- Since:
Returns:
Type |
Description |
Promise.<Number>
|
Code of the result of an operation |