D0301
HTML Application SDK  A0.101
Public Member Functions | Public Attributes | List of all members
FileManager Interface Reference

import"FileManagerPlugin.idl";

Public Member Functions

String readFile ([in] String path, [in] Integer position, [in] Integer chunk_length)
 
enumerations writeFile ([in] String data, [in] String path, [in] Integer position, [in] enumerations mode, [in] Integer offset, [in] Integer chunk_length)
 

Public Attributes

const Integer BAD_PARAMETER = 7
 
const Integer DISK_FULL = 8
 
const Integer END_OF_DATA = 3
 
const Integer FILE_NOT_FOUND = 1
 
const Integer FILE_OPEN_ERROR = 2
 
const Integer FILE_READ_ERROR = 4
 
const Integer FILE_WRITE_ERROR = 5
 
const Integer FILE_WRITE_MODE_APPEND = 1
 
const Integer FILE_WRITE_MODE_POSITION = 2
 
const Integer FILE_WRITE_MODE_TRUNCATE = 0
 
const Integer MEMORY_ALLOC_FAIL = 6
 
const Integer NO_ERROR = 0
 
const Integer OPERATION_FAIL = 10
 
const Integer PERMISSION_DENIED = 9
 

Detailed Description

This is a class which implements global FileManager.

Member Function Documentation

String FileManager.readFile ( [in] String  path,
[in] Integer  position,
[in] Integer  chunk_length 
)

Read data from file.

var readContent = FileManager.readFile(fileToRead, position, chunkLength);
Parameters
pathPath of file. Throws exception if path is not a removable device path.
positionStarting position to read.
chunk_lengthNumber of bytes to read.
Returns
Data read from file, or empty string in case of error.
enumerations FileManager.writeFile ( [in] String  data,
[in] String  path,
[in] Integer  position,
[in] enumerations  mode,
[in] Integer  offset,
[in] Integer  chunk_length 
)

Write data to file.

var errorCode = FileManager.writeFile(textData, filePath, 0, FileManager.FILE_WRITE_MODE_TRUNCATE, 0, chunkLength);
Parameters
dataData to be written.
pathPath of file. If path is not a removable device path, FileManager.PERMISSION_DENIED error is returned.
positionStarting position for writing. Only valid if mode is set to FileManager.FILE_WRITE_MODE_POSITION.
modeWriting mode.
offsetOffset of data to be written.
chunk_lengthNumber of bytes to write. If chunk_length is greater than data byte length, it is set to data byte length. If offset+chunk_length is greater than data byte length, it is set to data_byte_length - offset.
Returns
Result of write operation.

Member Data Documentation

const Integer FileManager.BAD_PARAMETER = 7

An invalid parameter was passed to the function.

const Integer FileManager.DISK_FULL = 8

The relevant disk is full.

const Integer FileManager.END_OF_DATA = 3

End of data was reached.

const Integer FileManager.FILE_NOT_FOUND = 1

An invalid parameter was passed to the function.

const Integer FileManager.FILE_OPEN_ERROR = 2

Error attempting to open or create a file.

const Integer FileManager.FILE_READ_ERROR = 4

Error occurred while reading data from file.

const Integer FileManager.FILE_WRITE_ERROR = 5

Error occurred while writing data to file.

const Integer FileManager.FILE_WRITE_MODE_APPEND = 1

Append data to end of file. If file does not exists, first creates the file.

const Integer FileManager.FILE_WRITE_MODE_POSITION = 2

Write data to file starting from given position. File must exists.

const Integer FileManager.FILE_WRITE_MODE_TRUNCATE = 0

Override existing data. If file does not exists, first creates the file. Default mode.

const Integer FileManager.MEMORY_ALLOC_FAIL = 6

Unable to allocate memory within the implementation of a function.

const Integer FileManager.NO_ERROR = 0

Operation completed successfully.

const Integer FileManager.OPERATION_FAIL = 10

An unspecified error occurred.

const Integer FileManager.PERMISSION_DENIED = 9

Attempt to access a file or folder at invalid removable device path.


The documentation for this interface was generated from the following file: