×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    4

    error while using FileConnection!!!

    I can open a FileConnection to a directory and list the files inside. However, when I try to open a FileConnection to a file, lets say a file inside that directory, it says, "The requested protocol does not exist" but there is FileConnection API in my phone(6230i) and I check it in the begining. Does anyone know what the problem is? I assign "file///e:/"+fileName to file URL.

  2. #2
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: error while using FileConnection!!!

    Hi harlem13,

    I am afraid of your URL being incorrect. For E:/ you should use something like

    FileConnection fc = (FileConnection) Connector.open("file:///E:/");

    See:

    "An application opens a connection using Connector.open(). The input string must comprise a fully qualified, absolute pathname of the form file://<host>/<root>/<directory>/<directory>/.../<name>.

    The host element may be empty - and often will be, when the string refers to a file on the local host. The root directory corresponds to a logical mount point for a particular storage unit. Root names are device-specific."

    Take a look at the examples in the docs referenced below.

    Introduction To The FileConnection API (With Example) v1.1
    http://www.forum.nokia.com/info/sw.n..._v1_1.zip.html

    Getting Started with the FileConnection APIs
    http://developers.sun.com/techtopics...ion/index.html

    Hope it helps!

    BR

  3. #3
    Registered User
    Join Date
    Apr 2006
    Posts
    4

    Re: error while using FileConnection!!!

    Well, I looked at those documents long ago. I don't think that could be the problem because I can open a connection like,
    FileConnection fc = (FileConnection) Connector.open("file:///e:/");
    and then list all the names of the files within that directory. Next, I choose one file name from the list on my screen and add it to the string, "file:///e:/" . It is interesting, though.
    Thx anyway. I will appreciate any kind of help!

Similar Threads

  1. FileConnection SecurityException Access Denied?
    By sbwoodside in forum Mobile Java General
    Replies: 8
    Last Post: 2008-07-23, 12:41
  2. Manager.createPlayer with FileConnection in emulator still broken
    By BlueLava in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2006-02-22, 08:27
  3. Replies: 2
    Last Post: 2005-09-02, 10:57
  4. fileconnection api
    By beenicravi in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-08-08, 14:51
  5. Java FileConnection Optional Package 1.0 (JSR 75)
    By thecrowi in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-24, 08:29

Posting Permissions

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