mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
26.36.2009 df454f44bd8cc25001bc6d2bb2a4f1031bac9422
Fix for issue 3451 ("Unfinished" error message from ldapcompare --filename nosuchfile)
Use an specific error message when we cannot read the provided file.
2 files modified
26 ■■■■■ changed files
opendj-sdk/opends/src/messages/messages/tools.properties 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java 22 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/tools.properties
@@ -2463,3 +2463,7 @@
SEVERE_ERR_START_DATETIME_ALREADY_PASSED_1667=The specified start time '%s' \
 has already passed
SEVERE_ERR_LDAPCOMPARE_ERROR_READING_FILE_1668=An error occurred reading file \
 '%s'.  Check that the file exists and that you have read access rights to \
 it.  Details: %s
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.tools;
import org.opends.messages.Message;
@@ -933,7 +933,25 @@
        rdr = new InputStreamReader(System.in);
      } else if(fileNameValue != null)
      {
        rdr = new FileReader(fileNameValue);
        try
        {
          rdr = new FileReader(fileNameValue);
        }
        catch (Throwable t)
        {
          if (debugEnabled())
          {
            TRACER.debugCaught(DebugLogLevel.ERROR, t);
          }
          String details = t.getMessage();
          if (details == null)
          {
            details = t.toString();
          }
          err.println(wrapText(ERR_LDAPCOMPARE_ERROR_READING_FILE.get(
              fileNameValue, details), MAX_LINE_WIDTH));
          return 1;
        }
      }
      if(rdr != null)
      {