Results 1 to 2 of 2
  1. #1
    tiemykim is offline Member
    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    Default Writing to a file in a different folder

    Hey guys.

    Say I have two folders in my project:
    src/main/java
    src/main/resources

    And I have code in the src/main/java folder, and this code wants to load a file that is in the src/main/resources folder. How would I go about doing that without using the location like this "C:\Documents And Settings\Workspace..."

    Isn't there some way to use that path instead? Like this "/ProjectName/src/main/resources"?

    So my code looks like this:
    FileInputStream fis = new FileInputStream("what goes here?");

    Thanks

  2. #2
    gcalvin is offline Senior Member
    Join Date
    Mar 2010
    Posts
    953
    Rep Power
    5

    Default

    You should be able to use "../resources/filename.ext".

    -Gary-

Similar Threads

  1. Moving file to another folder
    By Aiden in forum New To Java
    Replies: 1
    Last Post: 03-03-2010, 07:47 AM
  2. Replies: 1
    Last Post: 02-27-2010, 01:29 AM
  3. need to get the file name from folder
    By naveen.dpt2007 in forum New To Java
    Replies: 2
    Last Post: 09-04-2009, 06:57 PM
  4. Copy a file to a folder.
    By leric in forum New To Java
    Replies: 7
    Last Post: 07-29-2009, 05:11 AM
  5. Replies: 3
    Last Post: 05-09-2009, 11:31 PM

Posting Permissions

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