1 Reply Latest reply on Oct 4, 2010 5:35 PM by 802951

    FileConnection API JSR 75

      I am trying this api on the WTK emulator and ther is an issue with show the valid roots and dir and files inside the roots.
      In the emulator there is one default root, this one:


      inside this root, there is one dir and one file, if run my code it shows well the root and its content. But if i create manually a dir or a file in the root, those arent show.

      I havent do a test on a real device but in the emulator it didnt work.

      What could be the problem ?

      this is my code:
      try {
               FileConnection fc = (FileConnection)
                  ("List of files and directories under root1:");
               Enumeration filelist = fc.list("*", true);
               while(filelist.hasMoreElements()) {
                  String fileName = (String) filelist.nextElement();
                  fc = (FileConnection)
                     Connector.open("file:///root1/" + fileName);
                  if(fc.isDirectory()) {
                     System.out.println("\tDirectory Name: " + fileName);
                  } else {
                        ("\tFile Name: " + fileName +
                         "\tSize: "+fc.fileSize());
            } catch (IOException ioe) {