In addition, there is an extra layer of restrictions with respect to file access. Depending on the security
domain the MIDlet has been assigned during installation, it will have access to a subset of the file system.
This is designed to protect the user data and prevent damage to the operating system. In particular, MIDlets
located in the trusted third-party and untrusted domains have access only to a set of designated public
directories including those for images, videos, public files, and a private directory assigned to each MIDlet
for its own usage. This is one reason why using virtual roots is recommended since access to the
Images/ root may be allowed but doing traversal from c:/ to c:/data/Images/ may not be allowed,
because c: could not be accessible by a MIDlet.
Several file-related operations check if the appropriate security permissions have been acquired, but you
should be careful in particular when the Connector.open() method is called. After a
FileConnection has been created and the appropriate permission has been granted, it could be assumed
that the permissions will hold for other operations requiring the same permission. For instance, once a
FileConnection has been created for writing, invoking delete should also have been authorized. If
the FileConnection has been created with a read permission and the delete() method is called, the
write permission will be needed and the user will be prompted if necessary.
The setFileConnection() method will also check for permissions to those files, depending on which
mode the original FileConnection was created. This is quite logical since setFileConnection
changes the current connection to point to a different file or directo