String (@NotNull String s) { if (WIN_DRIVE.matcher(s).matches()) { // No need to convert c:\ -> C: // Path.ancestor doens't work with it return s; } if (s.equals("/")) { return s; } return StringUtil.trimEnd(s, "/"); }