Code:public void showFile(String fileName) { try { String strPath = "file:///C:/"; FileConnection fc = (FileConnection)Connector.open(strPath +fileName, Connector.READ_WRITE); if(!fc.exists()) { Alert alertE = new Alert("Info:", "File does not exist", null, AlertType.INFO); Display.getDisplay(this).setCurrent(alertE); throw new IOException("File does not exist"); } else{ Alert alertE = new Alert("Info:", "File does exist", null, AlertType.INFO); Display.getDisplay(this).setCurrent(alertE); } //fc.setReadable(true); InputStream is = fc.openInputStream(); byte b[] = new byte[1024]; int length = is.read(b, 0, 1024); System.out.println("Content of "+ fileName + ": "); System.out.println(new String(b, 0, length)); Alert alertM = new Alert("Info:", new String(b, 0, length), null, AlertType.INFO); Display.getDisplay(this).setCurrent(alertM); } catch (Exception e) { System.out.println(e.getMessage()); Alert alert = new Alert("Info:", e.getMessage(), null, AlertType.INFO); Display.getDisplay(this).setCurrent(alert); //Display.getDisplay(this).vibrate(5000); }
I have this function to see a file, but give me an error saying: "Access denied". Even in my 6230i emulator give me the same error. I have the file that want to open on [mypath]:\Nokia_S40_DP20_SDK_6230i\bin\Storage\6230100\C\, but nothing happens, only the error.
What I have to do?

Reply With Quote
because I do not have the real phone. How can I try this out!?!?!?!?!?

