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

    Default Writing to a file in a different folder

    Hey guys.

    Say I have two folders in my project:

    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?");


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


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


Similar Threads

  1. Moving file to another folder
    By Aiden in forum New To Java
    Replies: 1
    Last Post: 03-03-2010, 08:47 AM
  2. Replies: 1
    Last Post: 02-27-2010, 02: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, 07:57 PM
  4. Copy a file to a folder.
    By leric in forum New To Java
    Replies: 7
    Last Post: 07-29-2009, 06:11 AM
  5. Replies: 3
    Last Post: 05-10-2009, 12:31 AM

Posting Permissions

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