aspose file tools*
The moose likes Beginning Java and the fly likes Cannot find file location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot find file location" Watch "Cannot find file location" New topic
Author

Cannot find file location

baran tamer
Ranch Hand

Joined: Jan 22, 2009
Posts: 33
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

Joined: Apr 08, 2009
Posts: 298
Try to get the path of that file, what do you get?
baran tamer
Ranch Hand

Joined: Jan 22, 2009
Posts: 33
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

Joined: Jan 22, 2009
Posts: 33
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

Joined: Apr 08, 2009
Posts: 298
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

Joined: Jan 22, 2009
Posts: 33
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

Joined: Apr 08, 2009
Posts: 298
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

Joined: Jul 26, 2007
Posts: 10535
    
    9

Try System.getProperty("user.dir")).
That will give you your current directory.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot find file location