-
Notifications
You must be signed in to change notification settings - Fork 789
FileSystem Mixin
dbradberry edited this page Feb 5, 2013
·
1 revision
The FileSystem Mixin provides access to the Android device’s underlying file system.
By allowing your Module to inherit from common.FileSystem
you gain the following methods@
-
cacheDir()
Returns the path of the directory used by the Agent to store cache files. -
deleteFile(source)
Deletes the filesource
from the Agent’s file system. -
downloadFile(source, destination, block_size=65536)
Downloads the filesource
(on the Agent) todestination
, on your local machine. -
exists(source)
True, if the filesource
exists on the Agent’s file system. -
fileSize(source)
Returns the size of the filesource
(on the Agent) in bytes. -
format_file_size(size)
Returns a human-readable representation ofsize
bytes in B, KiB, MiB or GiB. -
isDirectory(target)
True, if the filetarget
exists on the Agent’s file system and is a directory. -
isFile(target)
True, if the filetarget
exists on the Agent’s file system and is a regular file. -
listFiles(target)
Returns a list of all files in thetarget
directory, on the Agent’s file system. -
md5sum(source)
Returns the MD5 checksum ofsource
on the Agent’s file system (requires the ClassLoader mixin). -
readFile(source, block_size=65536)
Returns the contents of the filesource
on the Agent’s file system. -
uploadFile(source, destination, block_size=65536)
Upload a filesource
(from your local machine) asdestination
on the Agent’s file system. -
writeFile(destination, data, block_size=65536)
Writedata
into a filedestination
on the Agent’s file system.