You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by fe...@apache.org on 2011/03/25 09:32:55 UTC

svn commit: r1085282 - /directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java

Author: felixk
Date: Fri Mar 25 08:32:55 2011
New Revision: 1085282

URL: http://svn.apache.org/viewvc?rev=1085282&view=rev
Log:
Respect the return value of mkdirs

Modified:
    directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java

Modified: directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java?rev=1085282&r1=1085281&r2=1085282&view=diff
==============================================================================
--- directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java (original)
+++ directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java Fri Mar 25 08:32:55 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import java.io.File;
+import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -294,7 +295,11 @@ public class StandaloneLdapCodecService 
         }
         else if ( ! this.cacheDirectory.exists() )
         {
-            this.cacheDirectory.mkdirs();
+            if ( ! this.cacheDirectory.mkdirs() ) {
+                String msg = "The provided cache directory can't be created:" + this.cacheDirectory.getAbsolutePath();
+                LOG.error( msg );
+                throw new IllegalArgumentException( msg );
+            }
         }
         
         if ( this.cacheDirectory == null )