public String getDirectoryParameter(String parameter) throws IOException {
    String dir = getStringParameter(parameter);

    if (dir.length() > 0) {
      File temp = new File(dir);
      if (!temp.exists()) {
        FileUtil.mkdirs(temp);
      }
      if (!temp.isDirectory()) {
        throw new IOException("Configuration error. This is not a directory: " + dir);
      }
    }

    return dir;
  }