EMI.SYS.FILE.INFO

September 20th, 2009 Leave a comment Go to comments

File info currently could be used to check the file size or to see if the file is still being downloaded. The result contains optional fields: size and downloaded. Both fields are optional, but one of them has to be present in the result. Size stands for the file size or expected file size. If size is missing, it means that the expected file size is not known. If “downloaded” key is present in the result, it means that the file is being downloaded to the device. System will also keep a short list of previously completed operation results in case there have been some errors that resulted in file to be missing.

Request Parameters

Name Type Mandatory Description
session JSON String yes Session ID
filename JSON String yes Specify the local file name for which the information is retrieved

Response

Name Type Description
size JSON Int File Size
dewnloaded JSON Int Downloaded Bytes

Error Codes

Reference Description
EOK No errors (contains warnings)
EBADPARAM Error in parameters
ENOTFOUND The specified file not found
EGENERAL Some other error
ESESSION Session with the given ID is not found

Examples

Request to EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 1,
 "method": "emi.sys.file.info",
 "params": {
	"session":"some_session_id",
	"filename":"file.txt"
	}
}

Response from EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 1,
 "result":
	{
	"filename":"file.txt",
	"downloaded":1000
	}
}
  1. No comments yet.
  1. No trackbacks yet.