about java exceptions

i am using eclipse to write java servlets...it warns me sometimes to put try catch on some blocks of code...these exceptions are the defined exceptions in java library like;

NullPointerException,SQLException,DataFormatException etc...

but for example when i write a code like below it has mkdir() method...If the creation of folder fails how am i going to know that it is failed? eclipse dont warn me to cover it between try&catch and there is no defined exception about it...

File myfile=new File("path/newfolder");

if(!myfile.exits())

myfile.mkdir();

how am i going to catch and understand if folder creation fails?

thank you

Message was edited by:

netsonicc

[818 byte] By [netsonicca] at [2007-11-27 2:23:27]
# 1

http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#mkdir()

mkdir

public boolean mkdir()

Creates the directory named by this abstract pathname.

Returns:

true if and only if the directory was created; false otherwise

Throws:

SecurityException - If a security manager exists and its SecurityManager.checkWrite(java.lang.String) method does not permit the named directory to be created

hunter9000a at 2007-7-12 2:28:57 > top of Java-index,Java Essentials,New To Java...