facebook

Openning a resouce file

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #312565 Reply

    avishaic
    Member

    Trying to open a file using the Java.io.File.File(String Pathname) function

     
    String filename = "C:\data\sample.txt";
    if (!new File(filename)).exists())
    

    it works fine and the file is found (and exists)
    but if I write

     
    String filename = "sample.txt";
    

    I can’t file which directory I need to copy sample.txt to for it to work.
    I tried adding it as a resource with and without linking it to an existing file but could not get it to work.
    Please Help
    -A

    #312567 Reply

    davemeurer
    Member

    Hello,

    This is the Spring forum, so I’ll move your thread to the general development forum. You may also find your answer in a forum like Java Ranch or the File doc itself: http://download.oracle.com/javase/6/docs/api/java/io/File.html?is-external=true

    Kind regards,
    Dave

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Openning a resouce file

You must be logged in to post in the forum log in