public @NotNull String getParentDirectory() {
    Path parent = Paths.get(myDirectoryField.getText()).toAbsolutePath().getParent();
    return Objects.requireNonNull(parent).toAbsolutePath().toString();
  }
public @NotNull String getParentDirectory()