Hi all !
I have series 40 3rd edition nokia 5300 handset and it is also have JSR75 for file connectionapi !
I am also able to create regular file using j2me but I can'tcreate folder on file system. .
Its always gives me error like :
Java.io.IOException mkdir called for a file
like this
Note : I am able to create dir as well as file on nokia e50, sony ericsson z550i
void createFile(String newName, boolean isDirectory)
{
try
{
String path="file:///" +currDirName +newName;
System.out.println("PATH : "+path);
FileConnection fc = (FileConnection) Connector.open(path);
if (isDirectory)
{
fc.mkdir();
}
else
{
fc.create();
}
showCurrDir();
}
catch (Exception e)
{
String s = "Can not create file '" + newName + "'";
if (e.getMessage() != null && e.getMessage().length() > 0)
{
s += "\n" + e;
}
Alert alert = new Alert("Error!", s, null, AlertType.ERROR);
alert.setTimeout(Alert.FOREVER);
Display.getDisplay(this).setCurrent(alert);
// Restore the commands that were removed in commandAction()
Display.getDisplay(this).getCurrent().addCommand(creatOK);
Display.getDisplay(this).getCurrent().addCommand(back);
}
}
Reply me soon
Thanks..
Premal

Reply With Quote


