-
Notifications
You must be signed in to change notification settings - Fork 822
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 filesourcefrom 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 filesourceexists 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 ofsizebytes in B, KiB, MiB or GiB. -
isDirectory(target)
True, if the filetargetexists on the Agent’s file system and is a directory. -
isFile(target)
True, if the filetargetexists on the Agent’s file system and is a regular file. -
listFiles(target)
Returns a list of all files in thetargetdirectory, on the Agent’s file system. -
md5sum(source)
Returns the MD5 checksum ofsourceon the Agent’s file system (requires the ClassLoader mixin). -
readFile(source, block_size=65536)
Returns the contents of the filesourceon the Agent’s file system. -
uploadFile(source, destination, block_size=65536)
Upload a filesource(from your local machine) asdestinationon the Agent’s file system. -
writeFile(destination, data, block_size=65536)
Writedatainto a filedestinationon the Agent’s file system.