code: public static String normalizePath(String _path, boolean _appendFinalSeparator) {
          if (_path == null) {
              return _path;
          }
  
          String path = _path
              .replace("\\", FILE_SEPARATOR)
              .replace("/", FILE_SEPARATOR);
          if (_appendFinalSeparator && !path.endsWith(FILE_SEPARATOR)) {
              path += FILE_SEPARATOR;
          }
          return path;
      }
docs: Normalize a file system path expression for the current OS.
  Replaces path separators by this OS's path separator.
  Appends a final path separator if parameter is set
  and if not yet present.
  @param _path path
  @param _appendFinalSeparator controls appendix of separator at the end
  @return normalized path