title: How to rename file, Java.nio?
body: <p>Got a storage <code>"client_storage/"</code>, and I need to rename files in it.</p>
  
  <p>Using <code>TextInputDialog</code> to rename. </p>
  
  <p><code>TextInputDialog</code> work fine.</p>
  
  <p>But I've got an <code>Exception</code> in <code>Files.move()</code> method.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    public void renameFile(ActionEvent actionEvent) {
      TextInputDialog dialog = new TextInputDialog("Rename");
      dialog.setTitle("Rename");
      dialog.setHeaderText("Rename File");
      dialog.setContentText("New name");
      Optional&lt;String&gt; res = dialog.showAndWait();
  
      if (res.isPresent()) {
          try {
              Path paths = Paths.get("client_storage/" + ClientListView.getSelectionModel().getSelectedItems());
              Files.move(paths, paths.resolve(res.get()), StandardCopyOption.REPLACE_EXISTING);
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>got an Exception on this line:</p>
  
  <pre><code>Files.move(paths, paths.resolve(res.get()), StandardCopyOption.REPLACE_EXISTING);
  </code></pre>
  
  <p>what I'am doing wrong?</p>
  
  <pre><code>java.nio.file.NoSuchFileException: client_storage\[text file.txt];
  </code></pre>