opendj3/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/ConnectionFactoryProvider.java
@@ -378,7 +378,7 @@ if (trustStorePathArg.isPresent()) { // Check that the path exists and is readable final String value = trustStorePathArg.getValue(); if (!canRead(trustStorePathArg.getValue())) { if (!canReadPath(value)) { final LocalizableMessage message = ERR_CANNOT_READ_TRUSTSTORE.get(value); throw new ArgumentException(message); } @@ -387,7 +387,7 @@ if (keyStorePathArg.isPresent()) { // Check that the path exists and is readable final String value = keyStorePathArg.getValue(); if (!canRead(keyStorePathArg.getValue())) { if (!canReadPath(value)) { final LocalizableMessage message = ERR_CANNOT_READ_KEYSTORE.get(value); throw new ArgumentException(message); } @@ -464,7 +464,7 @@ * @return <CODE>true</CODE> if we can read on the provided path and * <CODE>false</CODE> otherwise. */ private boolean canRead(final String path) { private boolean canReadPath(final String path) { boolean canRead; final File file = new File(path); canRead = file.exists() && file.canRead(); opendj3/opendj-ldap-toolkit/src/test/java/com/forgerock/opendj/ldap/tools/ConnectionFactoryProviderTest.java
@@ -27,6 +27,8 @@ import static org.fest.assertions.Assertions.*; import java.io.File; import org.forgerock.i18n.LocalizableMessageBuilder; import org.forgerock.opendj.ldap.ConnectionFactory; import org.mockito.Mock; @@ -54,7 +56,8 @@ /** Issue OPENDJ-734 */ public void getConnectionFactoryShouldAllowNullTrustStorePassword() throws Exception { // provide a trustStorePath but no password String trustStorePath = getClass().getClassLoader().getResource("dummy-truststore").getFile(); String trustStorePath = new File(getClass().getClassLoader().getResource("dummy-truststore").toURI()) .getCanonicalPath(); argParser.parseArguments(new String[] { "--useStartTLS", "--trustStorePath", trustStorePath }); ConnectionFactory factory = connectionFactoryProvider.getConnectionFactory();