title: Gradle [Failed to create parent directory ... when creating directory ...] when trying to copy files
body: <p>I'm trying to copy some files into a specific folder that's located in a network server that requires for me to enter a username and password.</p>
  
  <p>I found <a href="https://bitbucket.org/davidmc24/gradle-site-plugin" rel="nofollow noreferrer">this</a> and I'm currently trying to get it to work but I'm stuck. I added site onto my build.gradle along with its url and authenticationInfo but I can't seem to figure out how to connect it with the copy task.</p>
  
  <p>So far I have:</p>
  
  <pre><code>site {
      url = 'sftp://MyServer/var/'
      authenticationInfo {
          userName = 'un'
          password = 'pw'
      }
  }
  
  task copyTask(type: Copy) {
      from "/LocalFolder/"
      into "sftp://MyServer/var/www/html/folder"
  }
  </code></pre>
  
  <p>When I run <code>./gradlew copyTask</code>, I get:</p>
  
  <pre><code>Execution failed for task ':copyTask'.
  \&gt; Failed to create parent directory '/www' when creating directory '/www/html/revealjs'
  </code></pre>
  
  <p>How can I copy my files from LocalFolder into "sftp://MyServer/var/www/html/folder" directory?</p>