This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "about file configuration" Watch "about file configuration" New topic
Author

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">
<value>d:/my</value>
</property>


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é
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: about file configuration
 
Similar Threads
Obfuscating Package Names
How to set up a relative path
Unable to Delete Folder + I can't belive i m posting this :(
JNDI properties for JBoss 4.2.2