File Management API
To ensure data and file persistence on the device, an API is required to access, modify, and delete files locally from the device. To work with files and folders, the com.softwareag.mobile.md.io.File class is now available.
Virtual file system
To provide a consistent way to work with files and directories on every mobile platform, a virtual file system will be introduced. Every root folder of the VFS will be mapped to the best suited folder on the device.
Path separator
For separating folders a slash symbol (“/”) will be used.
Root folders
The root of the VFS is “/”. It contains following root folders:
documents: for reading and writing access.
resources: for reading access only.
cache :for reading and writing access. The folder can be cleaned by system.
external_storage: for reading and writing access on external storage.
Valid characters for file and directory names
To avoid inconsistency between different platforms, the acceptable characters are reduced the following:
letters: A-Z, a-z
digits: 0-9
symbols: [-._]
By trying to use any other character an IllegalArgumentException will be thrown. However the list() method can return names with any symbols that the particular native file system allows. As result, they can not be used to construct new file instances based on its result. To operate such files you can use listFiles() method.