This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes getting the File from Current directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getting the File from Current directory" Watch "getting the File from Current directory" New topic
Author

getting the File from Current directory

Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 290

Hi
i have a file in folder called /util/xx.txt

my code is running in /run/runing.java

how can i get the file xx.txt from my code
[ June 08, 2008: Message edited by: Chiru Raj ]

-Chiru
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
By using an absolute path: new File("/util/xx.txt")
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: getting the File from Current directory
 
It's not a secret anymore!