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

neil_a_wilson
09.16.2006 0bfa14ac56a7fe9007a43e0f758df35a31743778
Update the LDAPCompare tool to replace references to fileURL for the assertion
value to filePath, since the expected value is a path and not a URL.

OpenDS Issue Number: 766
2 files modified
18 ■■■■ changed files
opends/src/server/org/opends/server/tools/LDAPCompare.java 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/LDAPToolUtils.java 10 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/LDAPCompare.java
@@ -423,7 +423,7 @@
      argParser.setUsageArgument(showUsage, out);
      controlStr = new StringArgument("controls", 'J', "controls", false,
                false, true,
                "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
                "{controloid[:criticality[:value|::b64value|:<filePath]]}",
                null, null, MSGID_DESCRIPTION_CONTROLS);
      argParser.addArgument(controlStr);
      verbose = new BooleanArgument("verbose", 'v', "verbose",
@@ -519,7 +519,7 @@
      err.println("Invalid attribute string:" + attributeString);
      err.println("Attribute string must be in one of the " +
      "following forms: attribute:value, attribute::base64value, " +
      "attribute:<fileURL" );
      "attribute:<filePath" );
      return 1;
    }
    attributeType = attributeString.substring(0, idx);
@@ -545,8 +545,8 @@
        }
      } else if(nextChar == '<')
      {
        String fileURL = remainder.substring(1, remainder.length());
        attributeVal = LDAPToolUtils.readBytesFromFile(fileURL);
        String filePath = remainder.substring(1, remainder.length());
        attributeVal = LDAPToolUtils.readBytesFromFile(filePath);
      } else
      {
        attributeVal = remainder.getBytes();
opends/src/server/org/opends/server/tools/LDAPToolUtils.java
@@ -132,17 +132,17 @@
  /**
   * Read the data from the specified file and return it in a byte array.
   *
   * @param  fileURL  The URL to the file that should be read.
   * @param  filePath  The path to the file that should be read.
   *
   * @return  A byte array containing the contents of the requested file.
   */
  public static byte[] readBytesFromFile(String fileURL)
  public static byte[] readBytesFromFile(String filePath)
  {
      byte[] val = null;
      FileInputStream fis = null;
      try
      {
        File file = new File(fileURL);
        File file = new File(filePath);
        fis = new FileInputStream (file);
        long length = file.length();
        val = new byte[(int)length];
@@ -157,14 +157,14 @@
        // Ensure all the bytes have been read in
        if (offset < val.length)
        {
          System.err.println("Could not completely read file "+fileURL);
          System.err.println("Could not completely read file "+filePath);
          return null;
        }
        return val;
      } catch(IOException ie)
      {
        System.err.println("Could not completely read file "+fileURL);
        System.err.println("Could not completely read file "+filePath);
        System.err.println(ie.getMessage());
        return null;
      } finally