File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes about file configuration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about file configuration" Watch "about file configuration" New topic

about file configuration

kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Hi all,

I am having this piece of code-

folderName is configured in xml as follows-
<property name="logBackupFolder">

at line 3 i am getting- dir : d:/My/2009-03-10_04-09-28 (it's correct)
but at line 5- newDir : false , which must be true.

Can you people please help me to find out where is the problem.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Does d:/my already exist ? If not, you'll probably be interested to look at another method called mkdirs().

[My Blog]
All roads lead to JavaRanch
kayanaat sidiqui
Ranch Hand

Joined: Sep 04, 2008
Posts: 122
Hi Christophe Verré,

Thanks for solution. it's working fine.

I just want to know that wether this code will behave in same manner on unix also?
I mean using mkdirs(), if folder doesnot exist, it will create.

Rob Spoor

Joined: Oct 27, 2005
Posts: 20276

mkdirs() will create all parent folders as needed on all platforms, so yes, this will also work on Unix. Well, as long as you have the rights to create the folders of course, but that is also an issue on Windows.

How To Ask Questions How To Answer Questions
I agree. Here's the link:
subject: about file configuration
jQuery in Action, 3rd edition