I am new in developing mobile applications and I hope you can help me for my problem. Currently, I am working on a kind of File Explorer for BB. That means the application enables to browse through the BB Store folders as well as the SD card - copy, rename, delete etc. files and directories.
In order to do this I use the FileConnection class. It works fine on the SD card. Howerver, if I want to edit files or directories (e.g. creating an new directory using FileConnection.mkdir() or only reading an image e.g. "file:///store/samples/pictures/image.jpg") in the BB store I always get a FileIOException.
I wonder if there are some special permissions for the BB store? How can I set the permission (FileConnection.setWriteable does not seem to work)?
Does anybody has any experiences storing content on the BB store?
Here my code:
//creating a directory
FileConnection fconn = (FileConnection)Connector.open(localPath);
// copy a file
FileConnection fconnFrom = (FileConnection)Connector.open(fromPath);
int fileSize = (int) fconnFrom.fileSize();
DataInputStream dataIn = fconnFrom.openDataInputStream();
data = new byte[fileSize];
dataIn.read(data, 0, fileSize);
FileConnection fconnTo = (FileConnection)Connector.open(toPath);
connTo.create(); // create the file if it doesn't exist
DataOutputStream dataOut = fconnTo.openDataOutputStream();
dataOut.write(data, 0, fileSize);
THX for help in advance.
P.S. sorry for my bad english, I hope you got my problem.