×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    4

    getClass().getResourceAsStream()

    I got an example to read a file having a line,

    InputStream is = getClass().getResourceAsStream("help.txt");

    but where shud I put this "help.txt" file if I use Wireless Toolkit???

    thanx.

  2. #2
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    97

    Re: getClass().getResourceAsStream()

    please read the following link-
    http://discussion.forum.nokia.com/fo...962#post466962
    I faced similar problen, hope u got ur problem solved..

    regards,
    sanjay

  3. #3
    Registered User
    Join Date
    Dec 2006
    Posts
    30

    Re: getClass().getResourceAsStream()

    YES SURE ...U CAN DO IT
    Last edited by mail_rahman; 2008-09-16 at 09:37.

  4. #4
    Registered User
    Join Date
    Aug 2008
    Posts
    4

    Re: getClass().getResourceAsStream()

    thanx.
    But i got my solution here,
    http://discussion.forum.nokia.com/fo...962#post466962

    May be I could not make you understood my problem.
    Now I have another problem,
    How can I make the files available in my mobile???

  5. #5
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    You place that file within your JAR along with your class files, I recommend to use the root or a special folder as this will stay the same.

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: getClass().getResourceAsStream()

    and include a leading slash in the file path (or the directory path inside the JAR). Like this

    InputStream is = getClass().getResourceAsStream("/help.txt");

    Hartti

Posting Permissions

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