directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1085282 - /directory/shared/trunk/ldap/codec/standalone/src/main/java/org/apache/directory/shared/ldap/codec/standalone/StandaloneLdapCodecService.java
Date Fri, 25 Mar 2011 08:32:55 GMT
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 )



Mime
View raw message