×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    12

    FileConnection not all files get displayed !

    Dear Expertise,

    when we try to display the available files an folders using FileConnection, we get only the folders, but no files, but for the last default folders like Images, Sound Clips, Video clips, it shows the files but ONLY the Sound file, or Video files !!,

    We need to show allll the files in all the folders ; anyway to do that ?

    herein the code :


    FileConnection fc = null;
    try {
    if(file_name.equals("file:///"))
    {
    Enumeration e = FileSystemRegistry.listRoots();
    this.setTitle(file_name);
    while(e.hasMoreElements())
    {
    String file_n = (String) e.nextElement();
    this.append(file_n,null);
    }
    return;
    }
    fc =(FileConnection) Connector.open(file_name,Connector.READ);
    this.setTitle(file_name);
    Enumeration e=fc.list();
    while(e.hasMoreElements())
    {
    String file_n = (String) e.nextElement();
    this.append(file_n,null);
    }
    }
    catch (IOException ex) {
    System.out.println("Error ---"+ex.toString());
    Alert soundAlert = new Alert("** Error **");
    soundAlert.setString("there is an error in accessing the path Phone memory/MMSFolder");
    soundAlert.setTimeout(Alert.FOREVER);
    Display.getDisplay(MenuMIDlet.instance).setCurrent(soundAlert,
    MenuMIDlet.mainMenu);
    return;
    }

  2. #2
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: FileConnection not all files get displayed !

    Hi Khamouda,

    Which phone r u testing ur application??

    have tested the sample application provided in
    http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html


    Wang

  3. #3
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: FileConnection not all files get displayed !

    Hi,
    check this

    try
    {
    fc = (FileConnection) Connector.open("file:///"+drive+path);

    Enumeration e = fc.list();
    while(e.hasMoreElements())
    {
    String dir=e.nextElement().toString();
    vect.addElement(dir);
    }

    }catch(Exception e)
    {
    System.out.println("Exception in showDFir() "+e);
    }finally
    {
    try{fc.close();}catch(Exception e){}
    }
    return vect;


    Thanks
    Soku

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: FileConnection not all files get displayed !

    I have exactly the same problem with a Nokia 6280.
    The root directories come back as :-
    C:/
    E:/
    But I can't list the contents of either root directory.
    The documentation suggests that
    file:///c:/
    should work - but no luck.
    When I issue
    fc = (FileConnection)Connector.open(url,Connector.READ);
    I get an Access denied exception.
    I have tried lots of combinations but no go.
    I have also looked at the system properties such as
    "fileconn.dir.memorycard.name"
    This returns
    /Gallery/Memory card/
    I can't get them to work either.

    Regards
    Don

  5. #5
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: FileConnection not all files get displayed !

    hi

    The documentation suggests that
    file:///c:/
    should work - but no luck.



    Hi,
    It wont work.try using

    file:///c:/nokia/Images
    Thanks
    Soku

  6. #6
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: FileConnection not all files get displayed !

    Hi,
    Changed program to try
    "file:///c:/nokia/Images"
    But still get Access denied
    Also tried
    "file:///c:/nokia/Images/"

    Where does the /nokia come from ?

    Regards
    Don

  7. #7
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: FileConnection not all files get displayed !

    Hi,


    What r the results u r getting while using
    System.getProperty("fileconn.dir.photos");
    System.getProperty("fileconn.dir.photos.name");

    When u trying to access a filesystem u will be shown an alert message saying whether u want to acces the phone filesystem and u have to accept it

    one thing did u try the sample application provided in
    http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html
    If so what was the result.

    Wang

  8. #8
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: FileConnection not all files get displayed !

    Hi,
    When I run the sample application I first get a message
    about
    Nokiafile:///c:/predefgallery/predefphotos/
    When I dismiss this I get the two root directories
    C:/
    E:/
    If I select either of these I get Access denied

    Interestingly - I have not seen the message asking for
    Midlet Suite read access - I see these on my PDA as
    the Midlets are not signed. This suggests I still have the
    naming wrong.

    System.getProperty("fileconn.dir.photos");
    returns file:///C:/predefgallery/predefphotos/
    System.getProperty("fileconn.dir.photos.name");
    returns /Gallery/Images

    Regards
    Don

  9. #9
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: FileConnection not all files get displayed !

    Hi,
    For 6280 is the uRL file:///c:/predefgallery/predefphotos/ working fine.

    Thanks
    Soku

  10. #10
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: FileConnection not all files get displayed !

    Hi,
    url = System.getProperty("fileconn.dir.photos");
    fc = (FileConnection)Connector.open(url,Connector.READ);
    ents = fc.list();

    url is set to
    file:///c:/predefgallery/predefphotos/

    I get an exception - Access denied

    Regards
    Don

  11. #11
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: FileConnection not all files get displayed !

    Hi donscales,
    The code you posted is right.I suppose the problem is with the security factors.have you signed your MIDlet.Also give a MIDlet permission as read and write as a JAD parameter.

    Thanks
    Soku

  12. #12
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: FileConnection not all files get displayed !

    Hi Soku,
    I have not had to use the Midlet permissions with my PDA
    development so I had not set them - oops
    I have now set
    MIDlet-Permissions: javax.microedition.io.Connector.file.read
    But still get Access denied

    If I highlight the Midlet (on the phone) and select Options
    and then select Application access and then Phone access
    I then select Read user data and I am told - Not allowed
    and I can't change it.

    I did not think I would have to use a signed Midlet during
    development - I expected to be asked if it was ok to read.

    Regards
    Don

  13. #13
    Super Contributor
    Join Date
    Feb 2006
    Posts
    689

    Re: FileConnection not all files get displayed !

    Hi Don,
    check your manifest file whether it is same as jad file.

    Thanks
    Soku

  14. #14
    Registered User
    Join Date
    May 2006
    Posts
    12

    Re: FileConnection not all files get displayed !

    Hi Soku,
    Yes - mainfest file has the same as the jad file
    Regards
    Don

  15. #15
    Super Contributor
    Join Date
    Mar 2006
    Posts
    516

    Re: FileConnection not all files get displayed !

    Donscales,

    you don't require the permissions in the jad file until u sign ur application.

    But here is a similar problem like u r facing and certain tips are discussed to over come the problem.
    Please try it
    http://discussion.forum.nokia.com/fo...ad.php?t=74986


    Wang

Similar Threads

  1. AMR files from WebServer
    By pjericoh in forum Mobile Java General
    Replies: 0
    Last Post: 2005-05-10, 22:20
  2. AMR files from WebServer
    By pjericoh in forum Audio
    Replies: 0
    Last Post: 2005-05-10, 21:31
  3. Java FileConnection Optional Package 1.0 (JSR 75)
    By thecrowi in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-24, 08:29
  4. Sending several files without using SIS
    By stopin in forum Symbian
    Replies: 0
    Last Post: 2003-07-10, 16:32
  5. Free Series 60 Files Browser
    By Jeepy in forum Symbian
    Replies: 0
    Last Post: 2003-06-13, 10:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×