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

chebrard
29.39.2008 43ba6d721185f9a810761720fcb05103b31d17b7
opends/src/server/org/opends/server/tasks/AddSchemaFileTask.java
@@ -127,7 +127,10 @@
    // Get the name(s) of the schema files to add and make sure they exist in
    // the schema directory.
    String schemaDirectory = SchemaConfigManager.getSchemaDirectoryPath();
    String schemaInstallDirectory  =
      SchemaConfigManager.getSchemaDirectoryPath(false);
    String schemaInstanceDirectory =
      SchemaConfigManager.getSchemaDirectoryPath(true);
    filesToAdd = new TreeSet<String>();
    for (Attribute a : attrList)
    {
@@ -138,14 +141,19 @@
        try
        {
          File schemaFile = new File(schemaDirectory, filename);
          File schemaFile = new File(schemaInstallDirectory, filename);
          if ((! schemaFile.exists()) ||
              (! schemaFile.getParent().equals(schemaDirectory)))
              (! schemaFile.getParent().equals(schemaInstallDirectory)))
          {
            // try in the instance
            schemaFile = new File(schemaInstanceDirectory, filename);
            if (! schemaFile.exists())
            {
            Message message = ERR_TASK_ADDSCHEMAFILE_NO_SUCH_FILE.get(
                filename, schemaDirectory);
                filename, schemaInstallDirectory, schemaInstanceDirectory);
            throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
                                         message);
            }
          }
        }
        catch (Exception e)
@@ -156,7 +164,8 @@
          }
          Message message = ERR_TASK_ADDSCHEMAFILE_ERROR_CHECKING_FOR_FILE.get(
              filename, schemaDirectory, getExceptionMessage(e));
              filename, schemaInstallDirectory, schemaInstanceDirectory,
              getExceptionMessage(e));
          throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
                                       message, e);
        }