import"StorageManagerPlugin.idl";
This is a class which implements global StorageManager object.
void StorageManager.addEventListener |
( |
[in] String |
event_name, |
|
|
[in] EventListener |
listener |
|
) |
| |
Adds DOM2 event listener for specified event.
Possible values are: event_name: "removableDeviceConnected", listener: function that has arguments similar to the removableDeviceConnected interface properties. event_name: "removableDeviceDisconnected", listener: function that has arguments similar to the removableDeviceDisconnected interface properties. event_name: "mediaFileReadProgressEvent", listener: function that has arguments similar to the mediaFileReadProgressEvent interface properties.
- Parameters
-
event_name | Name of the event. |
listener | javascript function that has arguments like the properties listed in the listener's interface. |
StorageInfo StorageManager.checkEmptySpace |
( |
[in] String |
path | ) |
|
This function returns the StorageInfo object. return value corresponds to the available space of removable device in kB and errorCode corresponds to the file system error code.
expect(spaceInfo.errorCode).toBe(
StorageManager.
NoError,
"Check empty space operation for a valid USB path cannot be done without error");
expect(spaceInfo.returnValue).toBeGreaterThan(0, "Check empty space operation for a valid USB path does not give nonzero free space information");
- Parameters
-
path | absolute path of removable device that will be checked for empty space |
- Returns
- File System Errors: NoError:0, BadParameter:7, DiskMissing:9, OperationFail:14 / and available space
StorageInfo StorageManager.checkTotalSize |
( |
[in] String |
path | ) |
|
This function returns the StorageInfo object. return value corresponds to the total size of removable device in kB and errorCode corresponds to the file system error code.
expect(spaceInfo.errorCode).toBe(
StorageManager.
NoError,
"Check total size operation for a valid USB path cannot be done without error");
expect(spaceInfo.returnValue).toBeGreaterThan(0, "Check total size operation for a valid USB path does not give nonzero total size information");
- Parameters
-
path | absolute path of removable device that will be checked for total size |
- Returns
- File System Errors: NoError:0, BadParameter:7, DiskMissing:9, OperationFail:14 / and total size
enumerations StorageManager.copy |
( |
[in] String |
filePath, |
|
|
[in] String |
newPath |
|
) |
| |
This function copies the file given to path given. Any folder can be copied by using this function only if the filePath ends with '/' character. If newPath belongs to an existing file, it overwrites the file and returns NoError. If newPath does not include a file extension and there is not a folder with the same name, it copies to the given path and returns NoError. If newPath does not include a file extension and there is a folder with the same name, it copies the file with original name to the folder and returns NoError.
StorageManager.
copy(usbPath +
"html_app_sdk_tests/manual/img/arrow_down_64x64.png", testFolder +
"test_img");
- Parameters
-
filePath | absolute path of the file that will be copied |
newPath | new absolute path that the file will be copied to |
- Returns
- File System Errors: NoError:0, OpenError:2, BadParameter:7, PermissionDenied:13, OperationFail:14
enumerations StorageManager.delete |
( |
[in] String |
filePath | ) |
|
This function deletes the file or the folder given. It deletes the folder even it is not empty, so consider this while calling delete function.
- Parameters
-
filePath | absolute path of the file that will be deleted |
- Returns
- File System Errors: NoError:0, FileNotFound:1, MemoryAllocFail:6, PermissionDenied:13, OperationFail:14
enumerations StorageManager.format |
( |
[in] String |
path | ) |
|
This function formats removable device given.
- Parameters
-
path | absolute path of removable device that will be formatted |
- Returns
- File System Errors: NoError:0, BadParameter:7, PermissionDenied:13, OperationFail:14
Boolean StorageManager.getFileExistence |
( |
[in] String |
path | ) |
|
This function checks whether the file/folder in the given path exists.
- Parameters
-
path | absolute path of the file that will be checked |
- Returns
- true if the file exists; false, otherwise.
String StorageManager.getFileMd5 |
( |
[in] String |
filePath | ) |
|
This function returns MD5 of a file stored on the storage. It will throw 'Invalid file' exception if file does not exist, path is not valid, or it is not accessible. It will throw 'File read error' exception if file cannot be opened.
- Parameters
-
filePath | absolute path of the file whose MD5 will be get |
- Returns
- MD5 of the file on success; empty string, otherwise.
Float StorageManager.getFileSize |
( |
[in] String |
filePath | ) |
|
This function returns the size of a given file in kB. It will throw 'Invalid file' exception if file does not exist, path is not valid, or it is not accessible.
- Parameters
-
filePath | absolute path of the file whose size will be get |
- Returns
- Size of the file.
String StorageManager.getLastMountedUSBPath |
( |
| ) |
|
This function returns the path where the last external USB is mounted.
- Returns
- Last mounted USB on success; throws error if no USB is mounted.
This function returns avaliable storages.
- Returns
- List of removable devices
void StorageManager.getListOfPlayableFiles |
( |
[in] String |
path, |
|
|
[in] enumerations |
filetype |
|
) |
| |
This function sets mediaFileReadProgressEvent. List will be sent through mediaFileReadProgressEvent event and when progress is finished,mediaFileReadProgressCompletedEvent will come.
- Parameters
-
path | Absolute path of a removable device. In case of wrong path that does not corresspond a removable device it will throw 'Not a removable device path' exception |
filetype | Type of file which is wanted to be listed: MediaTypePicture:0, MediaTypeAudio:1, MediaTypeVideo:2, MediaTypeAll:4 |
Boolean StorageManager.isFormatRequired |
( |
[in] String |
path | ) |
|
This function checks whether format of given device is required or not.
- Parameters
-
path | absolute path of removable device that will be checked |
- Returns
- true if format is required; false, otherwise.
Boolean StorageManager.isInternalUSB |
( |
[in] String |
path | ) |
|
This function checks whether the given device is internal or external device.
- Parameters
-
path | absolute path of removable device that will be checked |
- Returns
- true if the device is internal; false, otherwise.
enumerations StorageManager.listFiles |
( |
[in] String |
path | ) |
|
enumerations StorageManager.makeDir |
( |
[in] String |
path | ) |
|
This function creates new folder.
testFolder = usbPath + "storage_manager_tests/";
- Parameters
-
path | absolute path of the file that will be created |
- Returns
- File System Errors: NoError:0, DirPathNotFound:11, DirAlreadyExists:12, PermissionDenied:13, OperationFail:14
void StorageManager.removeEventListener |
( |
[in] String |
event_name, |
|
|
[in] EventListener |
listener |
|
) |
| |
Removes single DOM2 event listener for specified event
Possible values are: event_name: "removableDeviceConnected", listener: function that has arguments similar to the removableDeviceConnected interface properties. event_name: "removableDeviceDisconnected", listener: function that has arguments similar to the removableDeviceDisconnected interface properties. event_name: "mediaFileReadProgressEvent", listener: function that has arguments similar to the mediaFileReadProgressEvent interface properties.
- Parameters
-
event_name | Name of the event |
listener | named javascript function that has arguments like the properties listed in the listener's interface. |
void StorageManager.removeEventListener |
( |
[in] String |
event_name | ) |
|
enumerations StorageManager.rename |
( |
[in] String |
filePath, |
|
|
[in] String |
newName |
|
) |
| |
This function moves the file or folder given to the path given. If the given path belongs to an existing non-empty folder, it does not overwrite this folder and returns DirAlreadyExists. If the given path belongs to an existing empty folder, it overwrites this folder and returns NoError. If the given path belongs to an existing file, it overwrites the file and returns NoError.
- Parameters
-
filePath | absolute path of the file that will be renamed |
newName | new name with absolute path of the file |
- Returns
- File System Errors: NoError:0, FileNotFound:1, DirAlreadyExists:12, PermissionDenied:13, OperationFail:14
enumerations StorageManager.unzip |
( |
[in] String |
file, |
|
|
[in] String |
path |
|
) |
| |
This function decompresses the zip file given.
var errorCode =
StorageManager.
unzip(usbPath +
"html_app_sdk_tests/resource/unzip.zip", testFolder +
"unzip");
- Parameters
-
file | absolute path of zip file that will be extracted |
path | absolute path where zip file will be extracted into |
- Returns
- File System Errors: NoError:0, DirPathNotFound:11, DirAlreadyExists:12, PermissionDenied:13, OperationFail:14
const Integer StorageManager.BadParameter = 7 |
An invalid parameter was passed to the function.
const Integer StorageManager.DeviceTypeDlna = 1 |
const Integer StorageManager.DeviceTypeUsb = 0 |
const Integer StorageManager.DirAlreadyExists = 12 |
Attempt was made to create a directory that already exists.
const Integer StorageManager.DirNotEmpty = 10 |
Attempt was made to delete a directory that is not empty.
const Integer StorageManager.DirPathNotFound = 11 |
Attempt was made to create a directory with a filespec that
const Integer StorageManager.DiskFull = 8 |
The relevant disk is full.
const Integer StorageManager.DiskMissing = 9 |
The drive's removable disk is not present – for future support.
const Integer StorageManager.EndOfData = 3 |
End of data was reached. This is end of file
const Integer StorageManager.Ext2 = 3 |
Removable device file system format ext2
const Integer StorageManager.Ext3 = 2 |
Removable device file system format ext3
const Integer StorageManager.Fat = 0 |
Removable device file system format fat
const Integer StorageManager.FileNotFound = 1 |
An invalid parameter was passed to the function.
const Integer StorageManager.MediaTypeAll = 4 |
const Integer StorageManager.MediaTypeAudio = 1 |
const Integer StorageManager.MediaTypePicture = 0 |
const Integer StorageManager.MediaTypeVideo = 2 |
const Integer StorageManager.MemoryAllocFail = 6 |
Unable to allocate memory within the implementation of a function.
const Integer StorageManager.NoError = 0 |
Operation completed successfully.
const Integer StorageManager.Ntfs = 1 |
Removable device file system format ntfs
const Integer StorageManager.OpenError = 2 |
Error attempting to open or create a file.
const Integer StorageManager.OperationFail = 14 |
An unspecified error occurred.
const Integer StorageManager.PermissionDenied = 13 |
Attempt to access a file or folder at invalid removable device path.
const Integer StorageManager.ReadError = 4 |
Error occurred reading data from the disk.
const Integer StorageManager.TypeFile = 0 |
const Integer StorageManager.TypeFolder = 1 |
const Integer StorageManager.TypeInvalid = 2 |
const Integer StorageManager.WriteError = 5 |
Error occurred writing data to the disk.
The documentation for this interface was generated from the following file: