code: public Node uploadFile( Session session,
                              String path,
                              URL contentUrl ) throws RepositoryException, IOException {
          isNotNull(session, "session");
          isNotNull(path, "path");
          isNotNull(contentUrl, "contentUrl");
  
          // Open the URL's stream first ...
          InputStream stream = contentUrl.openStream();
          return uploadFile(session, path, stream);
      }
docs: Upload the content at the supplied URL into the repository at the defined path, using the given session. This method will
  create a 'nt:file' node at the supplied path, and any non-existant ancestors with nodes of type 'nt:folder'. As defined by
  the JCR specification, the binary content (and other properties) will be placed on a child of the 'nt:file' node named
  'jcr:content' with a node type of 'nt:resource'.
  
  @param session the JCR session
  @param path the path to the file
  @param contentUrl the URL where the content can be found
  @return the newly created 'nt:file' node
  @throws RepositoryException if there is a problem uploading the file
  @throws IOException if there is a problem using the stream
  @throws IllegalArgumentException is any of the parameters are null