• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find file location

 
baran tamer
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I have a simple question , I have a visual web jsf project (Netbeans IDE)

Where should i put "myfile.txt" , so that i could reach to that file by a single command such as


Thanks.
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to get the path of that file, what do you get?
 
baran tamer
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am already able to do that by finding the whole path of the web application , and manage to find the file location.
But it seems like to much unnecessary work to me.
I am sure there is a folder that i can put the file i want in my web app structure , and reach it by just typing the file name "myfile.txt"

what do you think ?
 
baran tamer
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am already able to do that by finding the whole path of the web application , and manage to find the file location.
But it seems like to much unnecessary work to me.
I am sure there is a folder that i can put the file i want in my web app structure , and reach it by just typing the file name "myfile.txt"

what do you think ?
 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not really sure about what you want to do... I mean, you want to do File f = new File("somFile"); and get a file that you have in a specific folder in your webapp, is that?
 
baran tamer
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what i want to know is actually , when i write



what exact location is the web application looking to find the file myfile.txt ?

is it src folder ?, webinf folder? , root folder ? which one ?

 
Albareto McKenzie
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I answered you in the first post, if you get the path of that file you will see where the file has been created or picked from if exists
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try System.getProperty("user.dir")).
That will give you your current directory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic