dcsimg
Creating file in a location by giving relative path
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Unnikrishnan_TK
Posted On:   Friday, August 4, 2006 08:33 AM

How can i create a file in a location by giving relative path like '../Logger/notes.log' ?

Re: Creating file in a location by giving relative path

Posted By:   Stephen_Ostermiller  
Posted On:   Sunday, August 27, 2006 04:42 PM

Here is the crossplatform way to get to notes.log from the current directory given the relative structure of your example:


File getNotesLogFile(File currentDirectory){
return (
new File(
new File(
currentDirectory.getParentFile(),
"Logger"
),
"notes.log"
)
);
}
About | Sitemap | Contact